diff src/window.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 e769c912fcd9
line wrap: on
line diff
--- a/src/window.c
+++ b/src/window.c
@@ -4775,13 +4775,14 @@ win_remove(
     if (wp->w_prev != NULL)
 	wp->w_prev->w_next = wp->w_next;
     else if (tp == NULL)
-	firstwin = wp->w_next;
+	firstwin = curtab->tp_firstwin = wp->w_next;
     else
 	tp->tp_firstwin = wp->w_next;
+
     if (wp->w_next != NULL)
 	wp->w_next->w_prev = wp->w_prev;
     else if (tp == NULL)
-	lastwin = wp->w_prev;
+	lastwin = curtab->tp_lastwin = wp->w_prev;
     else
 	tp->tp_lastwin = wp->w_prev;
 }
@@ -6597,11 +6598,11 @@ restore_snapshot_rec(frame_T *sn, frame_
  */
     int
 switch_win(
-    win_T	**save_curwin UNUSED,
-    tabpage_T	**save_curtab UNUSED,
-    win_T	*win UNUSED,
-    tabpage_T	*tp UNUSED,
-    int		no_display UNUSED)
+    win_T	**save_curwin,
+    tabpage_T	**save_curtab,
+    win_T	*win,
+    tabpage_T	*tp,
+    int		no_display)
 {
 # ifdef FEAT_AUTOCMD
     block_autocmds();