mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.4215: illegal memory access when copying lines in Visual mode
Problem: Illegal memory access when copying lines in Visual mode.
Solution: Adjust the Visual position after copying lines.
dc5490e2cb
This commit is contained in:
parent
de673966c3
commit
b2b288f33c
@ -1099,6 +1099,9 @@ void ex_copy(linenr_T line1, linenr_T line2, linenr_T n)
|
||||
}
|
||||
|
||||
appended_lines_mark(n, count);
|
||||
if (VIsual_active) {
|
||||
check_pos(curbuf, &VIsual);
|
||||
}
|
||||
|
||||
msgmore((long)count);
|
||||
}
|
||||
|
@ -1151,5 +1151,16 @@ func Test_visual_reselect_with_count()
|
||||
call delete('XvisualReselect')
|
||||
endfunc
|
||||
|
||||
" this was leaving the end of the Visual area beyond the end of a line
|
||||
func Test_visual_ex_copy_line()
|
||||
new
|
||||
call setline(1, ["aaa", "bbbbbbbbbxbb"])
|
||||
/x
|
||||
exe "normal ggvjfxO"
|
||||
t0
|
||||
normal gNU
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Loading…
Reference in New Issue
Block a user