forked from aniani/vim
updated for version 7.3.759
Problem: MS-Windows: Updating the tabline is slow when there are many tabs. Solution: Disable redrawing while performing the update. (Arseny Kapoulkine)
This commit is contained in:
@@ -2452,7 +2452,6 @@ gui_mch_update_tabline(void)
|
|||||||
TCITEM tie;
|
TCITEM tie;
|
||||||
int nr = 0;
|
int nr = 0;
|
||||||
int curtabidx = 0;
|
int curtabidx = 0;
|
||||||
RECT rc;
|
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
static int use_unicode = FALSE;
|
static int use_unicode = FALSE;
|
||||||
int uu;
|
int uu;
|
||||||
@@ -2479,13 +2478,16 @@ gui_mch_update_tabline(void)
|
|||||||
tie.mask = TCIF_TEXT;
|
tie.mask = TCIF_TEXT;
|
||||||
tie.iImage = -1;
|
tie.iImage = -1;
|
||||||
|
|
||||||
|
/* Disable redraw for tab updates to eliminate O(N^2) draws. */
|
||||||
|
SendMessage(s_tabhwnd, WM_SETREDRAW, (WPARAM)FALSE, 0);
|
||||||
|
|
||||||
/* Add a label for each tab page. They all contain the same text area. */
|
/* Add a label for each tab page. They all contain the same text area. */
|
||||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next, ++nr)
|
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next, ++nr)
|
||||||
{
|
{
|
||||||
if (tp == curtab)
|
if (tp == curtab)
|
||||||
curtabidx = nr;
|
curtabidx = nr;
|
||||||
|
|
||||||
if (!TabCtrl_GetItemRect(s_tabhwnd, nr, &rc))
|
if (nr >= TabCtrl_GetItemCount(s_tabhwnd))
|
||||||
{
|
{
|
||||||
/* Add the tab */
|
/* Add the tab */
|
||||||
tie.pszText = "-Empty-";
|
tie.pszText = "-Empty-";
|
||||||
@@ -2519,11 +2521,14 @@ gui_mch_update_tabline(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Remove any old labels. */
|
/* Remove any old labels. */
|
||||||
while (TabCtrl_GetItemRect(s_tabhwnd, nr, &rc))
|
while (nr < TabCtrl_GetItemCount(s_tabhwnd))
|
||||||
TabCtrl_DeleteItem(s_tabhwnd, nr);
|
TabCtrl_DeleteItem(s_tabhwnd, nr);
|
||||||
|
|
||||||
if (TabCtrl_GetCurSel(s_tabhwnd) != curtabidx)
|
if (TabCtrl_GetCurSel(s_tabhwnd) != curtabidx)
|
||||||
TabCtrl_SetCurSel(s_tabhwnd, curtabidx);
|
TabCtrl_SetCurSel(s_tabhwnd, curtabidx);
|
||||||
|
|
||||||
|
/* Re-enable redraw. This should trigger a repaint. */
|
||||||
|
SendMessage(s_tabhwnd, WM_SETREDRAW, (WPARAM)TRUE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -725,6 +725,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
759,
|
||||||
/**/
|
/**/
|
||||||
758,
|
758,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user