summaryrefslogtreecommitdiffstats
path: root/src/evalvars.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-06 13:24:51 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-06 13:24:51 +0000
commit18f4740f043b353abe47b7a00131317052457686 (patch)
treee5c469ce7c20a1801a9340ab2027455e256f1b55 /src/evalvars.c
parenta33737b6d80f5461c1c6c4c96b5bc4964a737927 (diff)
patch 8.2.4018: ml_get error when win_execute redraws with Visual selectionv8.2.4018
Problem: ml_get error when win_execute redraws with Visual selection. Solution: Disable Visual area temporarily. (closes #9479)
Diffstat (limited to 'src/evalvars.c')
-rw-r--r--src/evalvars.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/evalvars.c b/src/evalvars.c
index 11770aa532..055d49f5ef 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -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)