comparison src/drawscreen.c @ 28177:f04a3ec65e2d v8.2.4614

patch 8.2.4614: redrawing too much when 'cursorline' is set Commit: https://github.com/vim/vim/commit/c20e46a4e3efcd408ef132872238144ea34f7ae5 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed Mar 23 14:55:23 2022 +0000 patch 8.2.4614: redrawing too much when 'cursorline' is set 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)
author Bram Moolenaar <Bram@vim.org>
date Wed, 23 Mar 2022 16:00:03 +0100
parents bef82285dda0
children bdd6df4832ba
comparison
equal deleted inserted replaced
28176:a394011bde90 28177:f04a3ec65e2d
1466 # define DID_NONE 1 // didn't update a line 1466 # define DID_NONE 1 // didn't update a line
1467 # define DID_LINE 2 // updated a normal line 1467 # define DID_LINE 2 // updated a normal line
1468 # define DID_FOLD 3 // updated a folded line 1468 # define DID_FOLD 3 // updated a folded line
1469 int did_update = DID_NONE; 1469 int did_update = DID_NONE;
1470 linenr_T syntax_last_parsed = 0; // last parsed text line 1470 linenr_T syntax_last_parsed = 0; // last parsed text line
1471 // remember the current w_last_cursorline, it changes when drawing the new
1472 // cursor line
1473 linenr_T last_cursorline = wp->w_last_cursorline;
1474 #endif 1471 #endif
1475 linenr_T mod_top = 0; 1472 linenr_T mod_top = 0;
1476 linenr_T mod_bot = 0; 1473 linenr_T mod_bot = 0;
1477 #if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA) 1474 #if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA)
1478 int save_got_int; 1475 int save_got_int;
2243 || (wp->w_match_head != NULL 2240 || (wp->w_match_head != NULL
2244 && buf->b_mod_xlines != 0) 2241 && buf->b_mod_xlines != 0)
2245 #endif 2242 #endif
2246 )))) 2243 ))))
2247 #ifdef FEAT_SYN_HL 2244 #ifdef FEAT_SYN_HL
2248 || (wp->w_p_cul && (lnum == wp->w_cursor.lnum 2245 || (wp->w_p_cul && lnum == wp->w_cursor.lnum)
2249 || lnum == last_cursorline)) 2246 || lnum == wp->w_last_cursorline
2250 #endif 2247 #endif
2251 ) 2248 )
2252 { 2249 {
2253 #ifdef FEAT_SEARCH_EXTRA 2250 #ifdef FEAT_SEARCH_EXTRA
2254 if (lnum == mod_top) 2251 if (lnum == mod_top)
2549 break; 2546 break;
2550 } 2547 }
2551 2548
2552 // End of loop over all window lines. 2549 // End of loop over all window lines.
2553 2550
2551 #ifdef FEAT_SYN_HL
2552 // Now that the window has been redrawn with the old and new cursor line,
2553 // update w_last_cursorline.
2554 wp->w_last_cursorline = wp->w_p_cul ? wp->w_cursor.lnum : 0;
2555 #endif
2556
2554 #ifdef FEAT_VTP 2557 #ifdef FEAT_VTP
2555 // Rewrite the character at the end of the screen line. 2558 // Rewrite the character at the end of the screen line.
2556 // See the version that was fixed. 2559 // See the version that was fixed.
2557 if (use_vtp() && get_conpty_fix_type() < 1) 2560 if (use_vtp() && get_conpty_fix_type() < 1)
2558 { 2561 {