1
0
forked from aniani/vim

patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'

Problem:    Test_copy_winopt() does not restore 'hidden'.
Solution:   Restore the option, fix indent. (Ozaki Kiichi, closes #3367)
This commit is contained in:
Bram Moolenaar
2018-08-23 22:20:35 +02:00
parent 4edfe2d2a2
commit 7cb33a14c9
2 changed files with 49 additions and 45 deletions

View File

@@ -350,55 +350,57 @@ func Test_backupskip()
endfunc endfunc
func Test_copy_winopt() func Test_copy_winopt()
set hidden set hidden
" Test copy option from current buffer in window " Test copy option from current buffer in window
split split
enew enew
setlocal numberwidth=5 setlocal numberwidth=5
wincmd w wincmd w
call assert_equal(4,&numberwidth) call assert_equal(4,&numberwidth)
bnext bnext
call assert_equal(5,&numberwidth) call assert_equal(5,&numberwidth)
bw! bw!
call assert_equal(4,&numberwidth) call assert_equal(4,&numberwidth)
" Test copy value from window that used to be display the buffer " Test copy value from window that used to be display the buffer
split split
enew enew
setlocal numberwidth=6 setlocal numberwidth=6
bnext bnext
wincmd w wincmd w
call assert_equal(4,&numberwidth) call assert_equal(4,&numberwidth)
bnext bnext
call assert_equal(6,&numberwidth) call assert_equal(6,&numberwidth)
bw! bw!
" Test that if buffer is current, don't use the stale cached value " Test that if buffer is current, don't use the stale cached value
" from the last time the buffer was displayed. " from the last time the buffer was displayed.
split split
enew enew
setlocal numberwidth=7 setlocal numberwidth=7
bnext bnext
bnext bnext
setlocal numberwidth=8 setlocal numberwidth=8
wincmd w wincmd w
call assert_equal(4,&numberwidth) call assert_equal(4,&numberwidth)
bnext bnext
call assert_equal(8,&numberwidth) call assert_equal(8,&numberwidth)
bw! bw!
" Test value is not copied if window already has seen the buffer " Test value is not copied if window already has seen the buffer
enew enew
split split
setlocal numberwidth=9 setlocal numberwidth=9
bnext bnext
setlocal numberwidth=10 setlocal numberwidth=10
wincmd w wincmd w
call assert_equal(4,&numberwidth) call assert_equal(4,&numberwidth)
bnext bnext
call assert_equal(4,&numberwidth) call assert_equal(4,&numberwidth)
bw! bw!
set hidden&
endfunc endfunc
func Test_shortmess_F() func Test_shortmess_F()

View File

@@ -794,6 +794,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
322,
/**/ /**/
321, 321,
/**/ /**/