diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-06-22 11:08:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-22 11:08:00 +0800 |
commit | f17d88c47a6a647f2230a61e7cd952926abc4473 (patch) | |
tree | e9c094fb636ce9f973161a24e227f67b39ae74be | |
parent | 34ae896b8221d73677ed353736f611e81ee6798c (diff) | |
download | rneovim-f17d88c47a6a647f2230a61e7cd952926abc4473.tar.gz rneovim-f17d88c47a6a647f2230a61e7cd952926abc4473.tar.bz2 rneovim-f17d88c47a6a647f2230a61e7cd952926abc4473.zip |
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)
https://github.com/vim/vim/commit/c829faa8211df52997c0b9ee49cdea0c8786b177
-rw-r--r-- | src/nvim/testdir/test_mksession.vim | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim index c55ba391a5..cf90e416c4 100644 --- a/src/nvim/testdir/test_mksession.vim +++ b/src/nvim/testdir/test_mksession.vim @@ -363,21 +363,29 @@ func Test_mkview_open_folds() call append(0, ['a', 'b', 'c']) 1,3fold + 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 - write! Xtestfile 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') |