summaryrefslogtreecommitdiffstats
path: root/src/evalfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-29 21:29:18 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-29 21:29:18 +0200
commit816968defc8ae79eb7e2319e991e74661be8d750 (patch)
treeddb01de7db656fdbd9f673e54785860c93379cf7 /src/evalfunc.c
parentd371bbe0ab4b07dd3aa8d0f77905d222f6c5fd7e (diff)
patch 8.0.1160: getting tab-local variable fails after closing windowv8.0.1160
Problem: Getting tab-local variable fails after closing window. Solution: set tp_firstwin and tp_lastwin. (Jason Franklin, closes #2170)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 7b019a53d7..55d22951aa 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -5183,8 +5183,8 @@ 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,
- tp->tp_firstwin == NULL ? firstwin : tp->tp_firstwin, tp, TRUE)
- == OK)
+ tp == curtab || tp->tp_firstwin == NULL ? firstwin
+ : tp->tp_firstwin, tp, TRUE) == OK)
{
/* look up the variable */
/* Let gettabvar({nr}, "") return the "t:" dictionary. */