0
0
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:
James McCoy 2022-06-19 17:16:18 +01:00 committed by Bram Moolenaar
parent e530395c2c
commit c829faa821
2 changed files with 17 additions and 7 deletions

View File

@ -583,21 +583,29 @@ func Test_mkview_open_folds()
call append(0, ['a', 'b', 'c'])
1,3fold
" zR affects 'foldlevel', make sure the option is applied after the folds
" have been recreated.
normal zR
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(2))
call assert_equal(-1, foldclosed(3))
mkview! Xtestview
source Xtestview
call assert_equal(-1, foldclosed(1))
call assert_equal(-1, foldclosed(2))
call assert_equal(-1, foldclosed(3))
call assert_notequal(-1, foldclosed(1))
call assert_notequal(-1, foldclosed(2))
call assert_notequal(-1, foldclosed(3))
call delete('Xtestview')
call delete('Xtestfile')

View File

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