mirror of
https://github.com/vim/vim.git
synced 2025-08-22 19:27:53 -04:00
patch 8.2.5132: :mkview test doesn't test much
Problem: :mkview test doesn't test much. Solution: Save the view with the folds closed. (James McCoy, closes #10596)
This commit is contained in:
parent
e530395c2c
commit
c829faa821
@ -583,21 +583,29 @@ func Test_mkview_open_folds()
|
|||||||
|
|
||||||
call append(0, ['a', 'b', 'c'])
|
call append(0, ['a', 'b', 'c'])
|
||||||
1,3fold
|
1,3fold
|
||||||
" zR affects 'foldlevel', make sure the option is applied after the folds
|
|
||||||
" have been recreated.
|
|
||||||
normal zR
|
|
||||||
write! Xtestfile
|
write! Xtestfile
|
||||||
|
|
||||||
|
call assert_notequal(-1, foldclosed(1))
|
||||||
|
call assert_notequal(-1, foldclosed(2))
|
||||||
|
call assert_notequal(-1, foldclosed(3))
|
||||||
|
|
||||||
|
" Save the view with folds closed
|
||||||
|
mkview! Xtestview
|
||||||
|
|
||||||
|
" zR affects 'foldlevel', make sure the option is applied after the folds
|
||||||
|
" have been recreated.
|
||||||
|
" Open folds to ensure they get closed when restoring the view
|
||||||
|
normal zR
|
||||||
|
|
||||||
call assert_equal(-1, foldclosed(1))
|
call assert_equal(-1, foldclosed(1))
|
||||||
call assert_equal(-1, foldclosed(2))
|
call assert_equal(-1, foldclosed(2))
|
||||||
call assert_equal(-1, foldclosed(3))
|
call assert_equal(-1, foldclosed(3))
|
||||||
|
|
||||||
mkview! Xtestview
|
|
||||||
source Xtestview
|
source Xtestview
|
||||||
|
|
||||||
call assert_equal(-1, foldclosed(1))
|
call assert_notequal(-1, foldclosed(1))
|
||||||
call assert_equal(-1, foldclosed(2))
|
call assert_notequal(-1, foldclosed(2))
|
||||||
call assert_equal(-1, foldclosed(3))
|
call assert_notequal(-1, foldclosed(3))
|
||||||
|
|
||||||
call delete('Xtestview')
|
call delete('Xtestview')
|
||||||
call delete('Xtestfile')
|
call delete('Xtestfile')
|
||||||
|
@ -734,6 +734,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 */
|
||||||
|
/**/
|
||||||
|
5132,
|
||||||
/**/
|
/**/
|
||||||
5131,
|
5131,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user