summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_mksession.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-02-01 19:24:55 +0100
committerBram Moolenaar <Bram@vim.org>2021-02-01 19:24:55 +0100
commitf9547eb6ef02e305203b859d2dcfdae930b9d544 (patch)
tree825661ccdf026bb8e954912baaae39acd1d8d540 /src/testdir/test_mksession.vim
parent5daa91162699e4f8b54f9d1caaaab2715038941c (diff)
patch 8.2.2447: 'foldlevel' not applied to folds restored from sessionv8.2.2447
Problem: 'foldlevel' not applied to folds restored from session. Solution: Set 'foldlevel' after creaiting the folds. (closes #7767)
Diffstat (limited to 'src/testdir/test_mksession.vim')
-rw-r--r--src/testdir/test_mksession.vim26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim
index 723eb8ed2d..82c96ce639 100644
--- a/src/testdir/test_mksession.vim
+++ b/src/testdir/test_mksession.vim
@@ -504,6 +504,32 @@ func Test_mkview_terminal_windows()
call delete('Xtestview')
endfunc
+func Test_mkview_open_folds()
+ enew!
+
+ 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_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 delete('Xtestview')
+ call delete('Xtestfile')
+ %bwipe
+endfunc
+
" Test :mkview with a file argument.
func Test_mkview_file()
" Create a view with line number and a fold.