mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
vim-patch:9.1.0141: Put in Visual mode wrong if it replaces fold marker (#27661)
Problem: Put in Visual mode wrong if it replaces fold marker.
Solution: Temporarily disable folding during put in Visual mode.
(zeertzjq)
fixes: vim/vim#14097
closes: vim/vim#14100
4e141c66b9
This commit is contained in:
@@ -294,5 +294,33 @@ func Test_put_in_last_displayed_line()
|
||||
call VerifyScreenDump(buf, 'Test_put_in_last_displayed_line_1', {})
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
func Test_put_visual_replace_whole_fold()
|
||||
new
|
||||
let lines = repeat(['{{{1', 'foo', 'bar', ''], 2)
|
||||
call setline(1, lines)
|
||||
setlocal foldmethod=marker
|
||||
call setreg('"', 'baz')
|
||||
call setreg('1', '')
|
||||
normal! Vp
|
||||
call assert_equal("{{{1\nfoo\nbar\n\n", getreg('1'))
|
||||
call assert_equal(['baz', '{{{1', 'foo', 'bar', ''], getline(1, '$'))
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_put_visual_replace_fold_marker()
|
||||
new
|
||||
let lines = repeat(['{{{1', 'foo', 'bar', ''], 4)
|
||||
call setline(1, lines)
|
||||
setlocal foldmethod=marker
|
||||
normal! Gkzo
|
||||
call setreg('"', '{{{1')
|
||||
call setreg('1', '')
|
||||
normal! Vp
|
||||
call assert_equal("{{{1\n", getreg('1'))
|
||||
call assert_equal(lines, getline(1, '$'))
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
Reference in New Issue
Block a user