0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.1.0372: screen updating slow when 'cursorline' is set

Problem:    Screen updating slow when 'cursorline' is set.
Solution:   Only redraw the old and new cursor line, not all lines.
This commit is contained in:
Bram Moolenaar
2018-09-12 21:52:18 +02:00
parent 643b614087
commit 90a997987d
5 changed files with 34 additions and 12 deletions

View File

@@ -496,6 +496,7 @@ redraw_after_callback(int call_update_screen)
*/
void
redrawWinline(
win_T *wp,
linenr_T lnum,
int invalid UNUSED) /* window line height is invalid now */
{
@@ -503,19 +504,19 @@ redrawWinline(
int i;
#endif
if (curwin->w_redraw_top == 0 || curwin->w_redraw_top > lnum)
curwin->w_redraw_top = lnum;
if (curwin->w_redraw_bot == 0 || curwin->w_redraw_bot < lnum)
curwin->w_redraw_bot = lnum;
redraw_later(VALID);
if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum)
wp->w_redraw_top = lnum;
if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum)
wp->w_redraw_bot = lnum;
redraw_win_later(wp, VALID);
#ifdef FEAT_FOLDING
if (invalid)
{
/* A w_lines[] entry for this lnum has become invalid. */
i = find_wl_entry(curwin, lnum);
i = find_wl_entry(wp, lnum);
if (i >= 0)
curwin->w_lines[i].wl_valid = FALSE;
wp->w_lines[i].wl_valid = FALSE;
}
#endif
}