mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
vim-patch:9.0.0017: accessing memory beyond the end of the line
Problem: Accessing memory beyond the end of the line.
Solution: Stop Visual mode when closing a window.
3d51ce18ab
This commit is contained in:
@@ -1431,5 +1431,17 @@ func Test_visual_paste_clipboard()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_visual_area_adjusted_when_hiding()
|
||||
" The Visual area ended after the end of the line after :hide
|
||||
call setline(1, 'xxx')
|
||||
vsplit Xfile
|
||||
call setline(1, 'xxxxxxxx')
|
||||
norm! $o
|
||||
hid
|
||||
norm! zW
|
||||
bwipe!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
@@ -2741,6 +2741,8 @@ int win_close(win_T *win, bool free_buf, bool force)
|
||||
* to be the last one left, return now.
|
||||
*/
|
||||
if (wp->w_buffer != curbuf) {
|
||||
reset_VIsual_and_resel(); // stop Visual mode
|
||||
|
||||
other_buffer = true;
|
||||
win->w_closing = true;
|
||||
apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, false, curbuf);
|
||||
|
Reference in New Issue
Block a user