patch 9.1.0889: Possible unnecessary redraw after adding/deleting lines Commit: https://github.com/vim/vim/commit/9f25a3a237156889df3df78dbd8f12ee6059e332 Author: zeertzjq <zeert...@outlook.com> Date: Tue Nov 26 15:08:02 2024 +0100
patch 9.1.0889: Possible unnecessary redraw after adding/deleting lines 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 <zeert...@outlook.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/src/drawscreen.c b/src/drawscreen.c index cf2e4c15a..778cda4d4 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -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)) { diff --git a/src/version.c b/src/version.c index 53cfc6c1c..2416ad19d 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 889, /**/ 888, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1tFwLJ-006bwk-OY%40256bit.org.