Hi,

I had a report that the tabline is not updated properly when closing a tab
after 7.4a.034.

How to reproduce:

  :for i in range(15) | tabe | endfor
  Then close tabs one by one using :q or <C-w><C-q>.

Attached patch fixes this.
The flickering issue fixed by 7.4a.034 occurs only when adding a new tab,
so this patch checks whether a tab is added or not.

Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


# HG changeset patch
# Parent 6eb1cf75a138f150ec4cecd33592b7a16e5c7aee
diff --git a/src/gui_w48.c b/src/gui_w48.c
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -2459,6 +2459,7 @@
     TCITEM	tie;
     int		nr = 0;
     int		curtabidx = 0;
+    int		tabadded = 0;
 #ifdef FEAT_MBYTE
     static int	use_unicode = FALSE;
     int		uu;
@@ -2499,6 +2500,7 @@
 	    /* Add the tab */
 	    tie.pszText = "-Empty-";
 	    TabCtrl_InsertItem(s_tabhwnd, nr, &tie);
+	    tabadded = 1;
 	}
 
 	get_tabline_label(tp, FALSE);
@@ -2531,12 +2533,15 @@
     while (nr < TabCtrl_GetItemCount(s_tabhwnd))
 	TabCtrl_DeleteItem(s_tabhwnd, nr);
 
+    if (!tabadded && TabCtrl_GetCurSel(s_tabhwnd) != curtabidx)
+	TabCtrl_SetCurSel(s_tabhwnd, curtabidx);
+
     /* Re-enable redraw and redraw. */
     SendMessage(s_tabhwnd, WM_SETREDRAW, (WPARAM)TRUE, 0);
     RedrawWindow(s_tabhwnd, NULL, NULL,
 		    RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
 
-    if (TabCtrl_GetCurSel(s_tabhwnd) != curtabidx)
+    if (tabadded && TabCtrl_GetCurSel(s_tabhwnd) != curtabidx)
 	TabCtrl_SetCurSel(s_tabhwnd, curtabidx);
 }
 

Raspunde prin e-mail lui