forked from aniani/vim
patch 9.1.0672: marker folds may get corrupted on undo
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: #15455
closes: #15466
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -1928,4 +1928,25 @@ func Test_cursor_down_fold_eob()
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user