aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-08-12 06:52:31 +0800
committerGitHub <noreply@github.com>2024-08-11 22:52:31 +0000
commit37d97e771e9140746629bc3e67ad2dfbd39888c5 (patch)
tree63bc47309d4a49cd15f81e6e84741a98b359ad3e /test
parent9b5ab66678f8efa1f5fe89205839fe053fe5efaf (diff)
downloadrneovim-37d97e771e9140746629bc3e67ad2dfbd39888c5.tar.gz
rneovim-37d97e771e9140746629bc3e67ad2dfbd39888c5.tar.bz2
rneovim-37d97e771e9140746629bc3e67ad2dfbd39888c5.zip
vim-patch:9.1.0672: marker folds may get corrupted on undo (#30026)
Problem: marker folds may get corrupted on undo (Yousef Mohammed) Solution: when adjusting folds, make sure that line1 is the lower limit and line2 is the upper line limit. In particular, line2 should not be able to get smaller than line1. fixes: vim/vim#15455 closes: vim/vim#15466 https://github.com/vim/vim/commit/8d02e5cf961b06da5bc490ac5972bcbc252c4793 Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_fold.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/old/testdir/test_fold.vim b/test/old/testdir/test_fold.vim
index a0eb3afdbb..6569e032f6 100644
--- a/test/old/testdir/test_fold.vim
+++ b/test/old/testdir/test_fold.vim
@@ -1756,4 +1756,25 @@ func Test_cursor_down_fold_eob()
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