summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_fold.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_fold.vim')
-rw-r--r--src/testdir/test_fold.vim35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/testdir/test_fold.vim b/src/testdir/test_fold.vim
index dedc4a2..17487a5 100644
--- a/src/testdir/test_fold.vim
+++ b/src/testdir/test_fold.vim
@@ -1914,4 +1914,39 @@ func Test_foldexpr_end_fold()
bwipe!
endfunc
+" Test moving cursor down to or beyond start of folded end of buffer.
+func Test_cursor_down_fold_eob()
+ call setline(1, range(1, 4))
+ norm Gzf2kj
+ call assert_equal(2, line('.'))
+ norm zojzc
+ call assert_equal(3, line('.'))
+ norm j
+ call assert_equal(3, line('.'))
+ norm k2j
+ call assert_equal(4, line('.'))
+ bwipe!
+endfunc
+
+" issue: #15455
+func Test_cursor_fold_marker_undo()
+ new
+ call setline(1, ['{{{', '', 'This is a Line', '', 'This is a Line', '', '}}}'])
+ let &ul=&ul
+ setl foldmethod=marker
+ call cursor(2, 1)
+ norm! zo1vjdu
+ call assert_equal(1, foldlevel('.'))
+ bwipe!
+ new
+ call setline(1, ['', '{{{', '', 'This is a Line', '', 'This is a Line', '', '}}}'])
+ let &ul=&ul
+ setl foldmethod=marker
+ call cursor(3, 1)
+ norm! zo
+ norm! vjdu
+ call assert_equal(1, foldlevel('.'))
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab