mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 06:58:35 +00:00
vim-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.
8d02ce1ed7
vim-patch:8.2.4218: illegal memory access with bracketed paste in Ex mode (N/A)
This commit is contained in:
@@ -1162,5 +1162,20 @@ func Test_visual_ex_copy_line()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
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
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -2633,6 +2633,10 @@ static void u_undo_end(bool did_undo, bool absolute, bool quiet)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (VIsual_active) {
|
||||||
|
check_pos(curbuf, &VIsual);
|
||||||
|
}
|
||||||
|
|
||||||
smsg_attr_keep(0,
|
smsg_attr_keep(0,
|
||||||
_("%" PRId64 " %s; %s #%" PRId64 " %s"),
|
_("%" PRId64 " %s; %s #%" PRId64 " %s"),
|
||||||
u_oldcount < 0 ? (int64_t)-u_oldcount : (int64_t)u_oldcount,
|
u_oldcount < 0 ? (int64_t)-u_oldcount : (int64_t)u_oldcount,
|
||||||
|
Reference in New Issue
Block a user