1
0
forked from aniani/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.
This commit is contained in:
Bram Moolenaar
2022-01-20 13:32:50 +00:00
parent 4ac893f321
commit 05b2761548
3 changed files with 18 additions and 1 deletions

View File

@@ -1691,6 +1691,11 @@ 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_all_later(NOT_VALID);
}
@@ -5332,7 +5337,7 @@ frame_remove(frame_T *frp)
win_alloc_lines(win_T *wp)
{
wp->w_lines_valid = 0;
wp->w_lines = ALLOC_CLEAR_MULT(wline_T, Rows );
wp->w_lines = ALLOC_CLEAR_MULT(wline_T, Rows);
if (wp->w_lines == NULL)
return FAIL;
return OK;