0
0
mirror of https://github.com/vim/vim.git synced 2025-10-14 07:04:10 -04:00

patch 8.2.4217: illegal memory access when undo makes Visual area invalid

Problem:    Illegal memory access when undo makes Visual area invalid.
Solution:   Correct the Visual area after undo.
This commit is contained in:
Bram Moolenaar
2022-01-25 18:24:00 +00:00
parent 06b77229ca
commit 8d02ce1ed7
3 changed files with 19 additions and 0 deletions

View File

@@ -1339,5 +1339,20 @@ func Test_visual_ex_copy_line()
bwipe!
endfunc
" This was leaving the end of the Visual area beyond the end of a line.
" Set 'undolevels' to start a new undo block.
func Test_visual_undo_deletes_last_line()
new
call setline(1, ["aaa", "ccc", "dyd"])
set undolevels=100
exe "normal obbbbbbbbbxbb\<Esc>"
set undolevels=100
/y
exe "normal ggvjfxO"
undo
normal gNU
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab