diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-02-01 21:34:36 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-02-01 21:42:26 -0500 |
commit | 65e51fca0e48a6ffe62902a56b417f120b0f11f7 (patch) | |
tree | c49c9e4477941b89b7fbb49532488bbc80418201 /src/nvim/testdir | |
parent | 2a6580a8e250ab175415d58749bbe2398648501e (diff) | |
download | rneovim-65e51fca0e48a6ffe62902a56b417f120b0f11f7.tar.gz rneovim-65e51fca0e48a6ffe62902a56b417f120b0f11f7.tar.bz2 rneovim-65e51fca0e48a6ffe62902a56b417f120b0f11f7.zip |
vim-patch:8.2.2447: 'foldlevel' not applied to folds restored from session
Problem: 'foldlevel' not applied to folds restored from session.
Solution: Set 'foldlevel' after creaiting the folds. (closes vim/vim#7767)
https://github.com/vim/vim/commit/f9547eb6ef02e305203b859d2dcfdae930b9d544
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_mksession.vim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim index f71da92bf8..88320e0c22 100644 --- a/src/nvim/testdir/test_mksession.vim +++ b/src/nvim/testdir/test_mksession.vim @@ -291,6 +291,32 @@ endfunc endif +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. |