mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
vim-patch:8.2.4154: ml_get error when exchanging windows in Visual mode
Problem: ml_get error when exchanging windows in Visual mode.
Solution: Correct end of Visual area when entering another buffer.
05b2761548
This commit is contained in:
parent
1bd6c0a05c
commit
6eec30ccfc
@ -1280,6 +1280,16 @@ func Test_visual_block_insert_round_off()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" this was causing an ml_get error
|
||||
func Test_visual_exchange_windows()
|
||||
enew!
|
||||
new
|
||||
call setline(1, ['foo', 'bar'])
|
||||
exe "normal G\<C-V>gg\<C-W>\<C-X>OO\<Esc>"
|
||||
bwipe!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" this was leaving the end of the Visual area beyond the end of a line
|
||||
func Test_visual_ex_copy_line()
|
||||
new
|
||||
|
@ -1727,6 +1727,12 @@ static void win_exchange(long Prenum)
|
||||
|
||||
(void)win_comp_pos(); // recompute window positions
|
||||
|
||||
if (wp->w_buffer != curbuf) {
|
||||
reset_VIsual_and_resel();
|
||||
} else if (VIsual_active) {
|
||||
wp->w_cursor = curwin->w_cursor;
|
||||
}
|
||||
|
||||
win_enter(wp, true);
|
||||
redraw_later(curwin, NOT_VALID);
|
||||
redraw_later(wp, NOT_VALID);
|
||||
|
Loading…
Reference in New Issue
Block a user