1
0
forked from aniani/vim

patch 8.2.4018: ml_get error when win_execute redraws with Visual selection

Problem:    ml_get error when win_execute redraws with Visual selection.
Solution:   Disable Visual area temporarily. (closes #9479)
This commit is contained in:
Bram Moolenaar
2022-01-06 13:24:51 +00:00
parent a33737b6d8
commit 18f4740f04
10 changed files with 109 additions and 88 deletions

View File

@@ -3769,8 +3769,7 @@ getwinvar(
dictitem_T *v;
tabpage_T *tp = NULL;
int done = FALSE;
win_T *oldcurwin;
tabpage_T *oldtabpage;
switchwin_T switchwin;
int need_switch_win;
if (off == 1)
@@ -3791,7 +3790,7 @@ getwinvar(
// autocommands get blocked.
need_switch_win = !(tp == curtab && win == curwin);
if (!need_switch_win
|| switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE) == OK)
|| switch_win(&switchwin, win, tp, TRUE) == OK)
{
if (*varname == '&')
{
@@ -3826,7 +3825,7 @@ getwinvar(
if (need_switch_win)
// restore previous notion of curwin
restore_win(oldcurwin, oldtabpage, TRUE);
restore_win(&switchwin, TRUE);
}
if (!done && argvars[off + 2].v_type != VAR_UNKNOWN)
@@ -3869,8 +3868,7 @@ set_option_from_tv(char_u *varname, typval_T *varp)
setwinvar(typval_T *argvars, int off)
{
win_T *win;
win_T *save_curwin;
tabpage_T *save_curtab;
switchwin_T switchwin;
int need_switch_win;
char_u *varname, *winvarname;
typval_T *varp;
@@ -3891,7 +3889,7 @@ setwinvar(typval_T *argvars, int off)
{
need_switch_win = !(tp == curtab && win == curwin);
if (!need_switch_win
|| switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == OK)
|| switch_win(&switchwin, win, tp, TRUE) == OK)
{
if (*varname == '&')
set_option_from_tv(varname + 1, varp);
@@ -3908,7 +3906,7 @@ setwinvar(typval_T *argvars, int off)
}
}
if (need_switch_win)
restore_win(save_curwin, save_curtab, TRUE);
restore_win(&switchwin, TRUE);
}
}
@@ -4165,8 +4163,8 @@ get_clear_redir_ga(void)
void
f_gettabvar(typval_T *argvars, typval_T *rettv)
{
win_T *oldcurwin;
tabpage_T *tp, *oldtabpage;
switchwin_T switchwin;
tabpage_T *tp;
dictitem_T *v;
char_u *varname;
int done = FALSE;
@@ -4185,7 +4183,7 @@ f_gettabvar(typval_T *argvars, typval_T *rettv)
{
// Set tp to be our tabpage, temporarily. Also set the window to the
// first window in the tabpage, otherwise the window is not valid.
if (switch_win(&oldcurwin, &oldtabpage,
if (switch_win(&switchwin,
tp == curtab || tp->tp_firstwin == NULL ? firstwin
: tp->tp_firstwin, tp, TRUE) == OK)
{
@@ -4200,7 +4198,7 @@ f_gettabvar(typval_T *argvars, typval_T *rettv)
}
// restore previous notion of curwin
restore_win(oldcurwin, oldtabpage, TRUE);
restore_win(&switchwin, TRUE);
}
if (!done && argvars[2].v_type != VAR_UNKNOWN)