mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
vim-patch:8.2.5132: :mkview test doesn't test much (#19045)
Problem: :mkview test doesn't test much.
Solution: Save the view with the folds closed. (James McCoy, closes vim/vim#10596)
c829faa821
This commit is contained in:
parent
34ae896b82
commit
f17d88c47a
@ -363,21 +363,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')
|
||||
|
Loading…
Reference in New Issue
Block a user