diff options
Diffstat (limited to 'src/testdir/test_fold.vim')
-rw-r--r-- | src/testdir/test_fold.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_fold.vim b/src/testdir/test_fold.vim index cb29d43d54..3c78e62c3e 100644 --- a/src/testdir/test_fold.vim +++ b/src/testdir/test_fold.vim @@ -1778,4 +1778,17 @@ func Test_foldexpr_return_empty_string() bwipe! endfunc +" Make sure that when ending a fold that hasn't been started, it does not +" start a new fold. +func Test_foldexpr_end_fold() + new + setlocal foldmethod=expr + let &l:foldexpr = 'v:lnum == 2 ? "<2" : "="' + call setline(1, range(1, 3)) + redraw + call assert_equal([0, 0, 0], range(1, 3)->map('foldlevel(v:val)')) + + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |