diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-12-12 17:12:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-12-12 17:12:25 +0100 |
commit | 4b166d0a6d06f9a8f2d6f7f3beb5e1edb9a4783c (patch) | |
tree | bf028d1a5f661397d72e454b5c9e8fbbe7c92072 | |
parent | cfde76c74dd0fb1723101fd6a0fba22d3c72a1ee (diff) | |
download | vim-4b166d0a6d06f9a8f2d6f7f3beb5e1edb9a4783c.zip |
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)
-rw-r--r-- | src/gui_w48.c | 11 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/gui_w48.c b/src/gui_w48.c index 61c53a7d6..a70fb259e 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -2452,7 +2452,6 @@ gui_mch_update_tabline(void) TCITEM tie; int nr = 0; int curtabidx = 0; - RECT rc; #ifdef FEAT_MBYTE static int use_unicode = FALSE; int uu; @@ -2479,13 +2478,16 @@ gui_mch_update_tabline(void) tie.mask = TCIF_TEXT; 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. */ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next, ++nr) { if (tp == curtab) curtabidx = nr; - if (!TabCtrl_GetItemRect(s_tabhwnd, nr, &rc)) + if (nr >= TabCtrl_GetItemCount(s_tabhwnd)) { /* Add the tab */ tie.pszText = "-Empty-"; @@ -2519,11 +2521,14 @@ gui_mch_update_tabline(void) } /* Remove any old labels. */ - while (TabCtrl_GetItemRect(s_tabhwnd, nr, &rc)) + while (nr < TabCtrl_GetItemCount(s_tabhwnd)) TabCtrl_DeleteItem(s_tabhwnd, nr); if (TabCtrl_GetCurSel(s_tabhwnd) != curtabidx) TabCtrl_SetCurSel(s_tabhwnd, curtabidx); + + /* Re-enable redraw. This should trigger a repaint. */ + SendMessage(s_tabhwnd, WM_SETREDRAW, (WPARAM)TRUE, 0); } /* diff --git a/src/version.c b/src/version.c index 5a0f8159b..e743fae50 100644 --- a/src/version.c +++ b/src/version.c @@ -726,6 +726,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 759, +/**/ 758, /**/ 757, |