summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2022-06-19 17:16:18 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-19 17:16:18 +0100
commitc829faa8211df52997c0b9ee49cdea0c8786b177 (patch)
tree2da1b67c06332da2ee6fbdf0eaae863c513a13aa
parente530395c2cd261d598094dc9ea785e90a753c5f1 (diff)
patch 8.2.5132: :mkview test doesn't test muchv8.2.5132
Problem: :mkview test doesn't test much. Solution: Save the view with the folds closed. (James McCoy, closes #10596)
-rw-r--r--src/testdir/test_mksession.vim18
-rw-r--r--src/version.c2
2 files changed, 15 insertions, 5 deletions
diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim
index 2e368df8d9..c916b1a517 100644
--- a/src/testdir/test_mksession.vim
+++ b/src/testdir/test_mksession.vim
@@ -583,21 +583,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')
diff --git a/src/version.c b/src/version.c
index b8bc580ad9..c045d17fb6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -735,6 +735,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 5132,
+/**/
5131,
/**/
5130,