1
0
forked from aniani/vim

patch 8.2.4996: setbufline() may change Visual selection

Problem:    setbufline() may change Visual selection. (Qiming Zhao)
Solution:   Disable Visual mode when using another buffer. (closes #10466)
This commit is contained in:
Bram Moolenaar
2022-05-22 11:59:25 +01:00
parent dafef51b1c
commit 0ad00a7fd3
3 changed files with 21 additions and 0 deletions

View File

@@ -222,4 +222,20 @@ func Test_appendbufline_redraw()
call delete('XscriptMatchCommon')
endfunc
func Test_setbufline_select_mode()
new
call setline(1, ['foo', 'bar'])
call feedkeys("j^v2l\<C-G>", 'nx')
let bufnr = bufadd('Xdummy')
call bufload(bufnr)
call setbufline(bufnr, 1, ['abc'])
call feedkeys("x", 'nx')
call assert_equal(['foo', 'x'], getline(1, 2))
exe "bwipe! " .. bufnr
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab