comparison src/gui_w48.c @ 5286:74a211a0d3a3 v7.4b.019

updated for version 7.4b.019 Problem: Tabline is not updated properly when closing a tab on Win32. Solution: Only reduce flickering when adding a tab. (Ken Takata)
author Bram Moolenaar <bram@vim.org>
date Wed, 07 Aug 2013 21:13:23 +0200
parents 8f983df0299f
children 359743c1f59a
comparison
equal deleted inserted replaced
5285:a1cf2af83e79 5286:74a211a0d3a3
2457 { 2457 {
2458 tabpage_T *tp; 2458 tabpage_T *tp;
2459 TCITEM tie; 2459 TCITEM tie;
2460 int nr = 0; 2460 int nr = 0;
2461 int curtabidx = 0; 2461 int curtabidx = 0;
2462 int tabadded = 0;
2462 #ifdef FEAT_MBYTE 2463 #ifdef FEAT_MBYTE
2463 static int use_unicode = FALSE; 2464 static int use_unicode = FALSE;
2464 int uu; 2465 int uu;
2465 WCHAR *wstr = NULL; 2466 WCHAR *wstr = NULL;
2466 #endif 2467 #endif
2497 if (nr >= TabCtrl_GetItemCount(s_tabhwnd)) 2498 if (nr >= TabCtrl_GetItemCount(s_tabhwnd))
2498 { 2499 {
2499 /* Add the tab */ 2500 /* Add the tab */
2500 tie.pszText = "-Empty-"; 2501 tie.pszText = "-Empty-";
2501 TabCtrl_InsertItem(s_tabhwnd, nr, &tie); 2502 TabCtrl_InsertItem(s_tabhwnd, nr, &tie);
2503 tabadded = 1;
2502 } 2504 }
2503 2505
2504 get_tabline_label(tp, FALSE); 2506 get_tabline_label(tp, FALSE);
2505 tie.pszText = NameBuff; 2507 tie.pszText = NameBuff;
2506 #ifdef FEAT_MBYTE 2508 #ifdef FEAT_MBYTE
2529 2531
2530 /* Remove any old labels. */ 2532 /* Remove any old labels. */
2531 while (nr < TabCtrl_GetItemCount(s_tabhwnd)) 2533 while (nr < TabCtrl_GetItemCount(s_tabhwnd))
2532 TabCtrl_DeleteItem(s_tabhwnd, nr); 2534 TabCtrl_DeleteItem(s_tabhwnd, nr);
2533 2535
2536 if (!tabadded && TabCtrl_GetCurSel(s_tabhwnd) != curtabidx)
2537 TabCtrl_SetCurSel(s_tabhwnd, curtabidx);
2538
2534 /* Re-enable redraw and redraw. */ 2539 /* Re-enable redraw and redraw. */
2535 SendMessage(s_tabhwnd, WM_SETREDRAW, (WPARAM)TRUE, 0); 2540 SendMessage(s_tabhwnd, WM_SETREDRAW, (WPARAM)TRUE, 0);
2536 RedrawWindow(s_tabhwnd, NULL, NULL, 2541 RedrawWindow(s_tabhwnd, NULL, NULL,
2537 RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN); 2542 RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
2538 2543
2539 if (TabCtrl_GetCurSel(s_tabhwnd) != curtabidx) 2544 if (tabadded && TabCtrl_GetCurSel(s_tabhwnd) != curtabidx)
2540 TabCtrl_SetCurSel(s_tabhwnd, curtabidx); 2545 TabCtrl_SetCurSel(s_tabhwnd, curtabidx);
2541 } 2546 }
2542 2547
2543 /* 2548 /*
2544 * Set the current tab to "nr". First tab is 1. 2549 * Set the current tab to "nr". First tab is 1.