diff src/evalfunc.c @ 12564:183dc24cf861 v8.0.1160

patch 8.0.1160: getting tab-local variable fails after closing window commit https://github.com/vim/vim/commit/816968defc8ae79eb7e2319e991e74661be8d750 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 29 21:29:18 2017 +0200 patch 8.0.1160: getting tab-local variable fails after closing window Problem: Getting tab-local variable fails after closing window. Solution: set tp_firstwin and tp_lastwin. (Jason Franklin, closes https://github.com/vim/vim/issues/2170)
author Christian Brabandt <cb@256bit.org>
date Fri, 29 Sep 2017 21:30:05 +0200
parents 972ea22c946f
children 351cf7c67bbe
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -5183,8 +5183,8 @@ f_gettabvar(typval_T *argvars, typval_T 
 	/* 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. */