]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0889: Possible unnecessary redraw after adding/deleting lines v9.1.0889
authorzeertzjq <zeertzjq@outlook.com>
Tue, 26 Nov 2024 14:08:02 +0000 (15:08 +0100)
committerChristian Brabandt <cb@256bit.org>
Tue, 26 Nov 2024 14:08:02 +0000 (15:08 +0100)
Problem:  Possible unnecessary redraw after adding/deleting lines.
Solution: Check b_mod_set before using b_mod_xlines to avoid using stale
          b_mod_xlines value (zeertzjq).

closes: #16124

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/drawscreen.c
src/version.c

index cf2e4c15ab72cbe37e6b0cb2ee1f28c486a22845..778cda4d4f4f59a4dcd30e4598d6a42843c6726a 100644 (file)
@@ -2255,6 +2255,7 @@ win_update(win_T *wp)
                                // match in fixed position might need redraw
                                // if lines were inserted or deleted
                                || (wp->w_match_head != NULL
+                                                   && buf->b_mod_set
                                                    && buf->b_mod_xlines != 0)
 #endif
                                ))))
@@ -2536,8 +2537,8 @@ win_update(win_T *wp)
            // - 'number' is set and below inserted/deleted lines, or
            // - 'relativenumber' is set and cursor moved vertically,
            // the text doesn't need to be redrawn, but the number column does.
-           if ((wp->w_p_nu && mod_top != 0
-                       && lnum >= mod_bot && buf->b_mod_xlines != 0)
+           if ((wp->w_p_nu && mod_top != 0 && lnum >= mod_bot
+                       && buf->b_mod_set && buf->b_mod_xlines != 0)
                    || (wp->w_p_rnu
                        && wp->w_last_cursor_lnum_rnu != wp->w_cursor.lnum))
            {
index 53cfc6c1c59e23cbf6b747ce17c6d98fef26fa1d..2416ad19d6c106f41db5e7f4a61dae3c0ae1b790 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    889,
 /**/
     888,
 /**/