vim-patch:7.4.349

Problem:    When there are matches to highlight the whole window is redrawn,
            which is slow.
Solution:   Only redraw everything when lines were inserted or deleted.
            Reset b_mod_xlines when needed.  (Alexey Radkov)

https://code.google.com/p/vim/source/detail?r=v7-4-349
This commit is contained in:
André Twupack 2014-09-11 20:43:47 +02:00
parent ba4acce341
commit 12ca4f582e
3 changed files with 8 additions and 5 deletions

View File

@ -1356,8 +1356,9 @@ static void win_update(win_T *wp)
(foldmethodIsSyntax(wp) (foldmethodIsSyntax(wp)
&& hasAnyFolding(wp)) || && hasAnyFolding(wp)) ||
syntax_check_changed(lnum))) syntax_check_changed(lnum)))
/* match in fixed position might need redraw */ // match in fixed position might need redraw
|| wp->w_match_head != NULL // if lines were inserted or deleted
|| (wp->w_match_head != NULL && buf->b_mod_xlines != 0)
))))) { ))))) {
if (lnum == mod_top) if (lnum == mod_top)
top_to_mod = FALSE; top_to_mod = FALSE;

View File

@ -246,7 +246,7 @@ static int included_patches[] = {
352, 352,
//351, //351,
//350, //350,
//349, 349,
348, 348,
//347, //347,
346, 346,

View File

@ -5323,12 +5323,13 @@ int match_add(win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos
wp->w_buffer->b_mod_bot = botlnum; wp->w_buffer->b_mod_bot = botlnum;
} }
} else { } else {
wp->w_buffer->b_mod_set = TRUE;
wp->w_buffer->b_mod_top = toplnum; wp->w_buffer->b_mod_top = toplnum;
wp->w_buffer->b_mod_bot = botlnum; wp->w_buffer->b_mod_bot = botlnum;
wp->w_buffer->b_mod_xlines = 0;
} }
m->pos.toplnum = toplnum; m->pos.toplnum = toplnum;
m->pos.botlnum = botlnum; m->pos.botlnum = botlnum;
wp->w_buffer->b_mod_set = TRUE;
rtype = VALID; rtype = VALID;
} }
} }
@ -5396,10 +5397,11 @@ int match_delete(win_T *wp, int id, int perr)
wp->w_buffer->b_mod_bot = cur->pos.botlnum; wp->w_buffer->b_mod_bot = cur->pos.botlnum;
} }
} else { } else {
wp->w_buffer->b_mod_set = TRUE;
wp->w_buffer->b_mod_top = cur->pos.toplnum; wp->w_buffer->b_mod_top = cur->pos.toplnum;
wp->w_buffer->b_mod_bot = cur->pos.botlnum; wp->w_buffer->b_mod_bot = cur->pos.botlnum;
wp->w_buffer->b_mod_xlines = 0;
} }
wp->w_buffer->b_mod_set = TRUE;
rtype = VALID; rtype = VALID;
} }
free(cur); free(cur);