Mercurial > vim
diff src/screen.c @ 14720:a9665096074b v8.1.0372
patch 8.1.0372: screen updating slow when 'cursorline' is set
commit https://github.com/vim/vim/commit/90a997987dbbe43af3c15118a35f658f0f037d1d
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 12 21:52:18 2018 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 12 Sep 2018 22:00:07 +0200 |
parents | f1b7d308de2f |
children | 90de24a1e9b7 |
line wrap: on
line diff
--- a/src/screen.c +++ b/src/screen.c @@ -496,6 +496,7 @@ redraw_after_callback(int call_update_sc */ 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 }