diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-03-23 14:55:23 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-23 14:55:23 +0000 |
commit | c20e46a4e3efcd408ef132872238144ea34f7ae5 (patch) | |
tree | 88e4c9c9113e2a70665b31e08c733a93f1e8bb57 /src/drawscreen.c | |
parent | 3c5999e53d9f35a30abefb7224f66a75c8ffb009 (diff) |
patch 8.2.4614: redrawing too much when 'cursorline' is setv8.2.4614
Problem: Redrawing too much when 'cursorline' is set and jumping around.
Solution: Rely on win_update() to redraw the current and previous cursor
line, do not mark lines as modified. (closes #9996)
Diffstat (limited to 'src/drawscreen.c')
-rw-r--r-- | src/drawscreen.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c index a562c4d84a..a902397cd7 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -1468,9 +1468,6 @@ win_update(win_T *wp) # define DID_FOLD 3 // updated a folded line int did_update = DID_NONE; linenr_T syntax_last_parsed = 0; // last parsed text line - // remember the current w_last_cursorline, it changes when drawing the new - // cursor line - linenr_T last_cursorline = wp->w_last_cursorline; #endif linenr_T mod_top = 0; linenr_T mod_bot = 0; @@ -2245,8 +2242,8 @@ win_update(win_T *wp) #endif )))) #ifdef FEAT_SYN_HL - || (wp->w_p_cul && (lnum == wp->w_cursor.lnum - || lnum == last_cursorline)) + || (wp->w_p_cul && lnum == wp->w_cursor.lnum) + || lnum == wp->w_last_cursorline #endif ) { @@ -2551,6 +2548,12 @@ win_update(win_T *wp) // End of loop over all window lines. +#ifdef FEAT_SYN_HL + // Now that the window has been redrawn with the old and new cursor line, + // update w_last_cursorline. + wp->w_last_cursorline = wp->w_p_cul ? wp->w_cursor.lnum : 0; +#endif + #ifdef FEAT_VTP // Rewrite the character at the end of the screen line. // See the version that was fixed. |