diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-09-12 23:06:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-12 23:06:26 +0200 |
commit | 7a26b9b62b5c5c69b4ea700eb8541721a763e734 (patch) | |
tree | cb9e061b24ca1229a591a33e801c09e02afbb11f /src/nvim/screen.c | |
parent | 9124bb755c410386efd3f030e54b2fbbe3fec193 (diff) | |
download | rneovim-7a26b9b62b5c5c69b4ea700eb8541721a763e734.tar.gz rneovim-7a26b9b62b5c5c69b4ea700eb8541721a763e734.tar.bz2 rneovim-7a26b9b62b5c5c69b4ea700eb8541721a763e734.zip |
vim-patch:8.1.0372: screen updating slow when 'cursorline' is set (#8986)
Problem: Screen updating slow when 'cursorline' is set.
Solution: Only redraw the old and new cursor line, not all lines.
https://github.com/vim/vim/commit/90a997987dbbe43af3c15118a35f658f0f037d1d
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index b4640cd49b..b38dff0d6c 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -200,24 +200,28 @@ void redraw_buf_later(buf_T *buf, int type) * may become invalid and the whole window will have to be redrawn. */ void -redrawWinline ( +redrawWinline( + win_T *wp, linenr_T lnum, int invalid /* window line height is invalid now */ ) { int i; - 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); if (invalid) { - /* A w_lines[] entry for this lnum has become invalid. */ - i = find_wl_entry(curwin, lnum); - if (i >= 0) - curwin->w_lines[i].wl_valid = FALSE; + // A w_lines[] entry for this lnum has become invalid. + i = find_wl_entry(wp, lnum); + if (i >= 0) { + wp->w_lines[i].wl_valid = false; + } } } |