From f2d90a351159fd6843f450850f52004f42e00183 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 12 Feb 2024 20:28:01 +0100 Subject: patch 9.1.0100: Redrawing can be improved with undo and 'spell' Problem: When undoing with 'spell', redrawWinline() is called after changed_lines(), while later win_update() sets redraw type to UPD_NOT_VALID, even though w_redraw_top and w_redraw_bot are still valid. Solution: Only set redraw type to UPD_NOT_VALID when inserting/deleting lines after parts of window has pending redraw, i.e., when changed_lines() is called after redrawWinline(). (zeertzjq) closes: #14019 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- src/change.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/change.c') diff --git a/src/change.c b/src/change.c index 0ea424f989..42e6f7939c 100644 --- a/src/change.c +++ b/src/change.c @@ -559,6 +559,12 @@ changed_common( if (!redraw_not_allowed && wp->w_redr_type < UPD_VALID) wp->w_redr_type = UPD_VALID; + // When inserting/deleting lines and the window has specific lines + // to be redrawn, w_redraw_top and w_redraw_bot may now be invalid, + // so just redraw everything. + if (xtra != 0 && wp->w_redraw_top != 0) + redraw_win_later(wp, UPD_NOT_VALID); + // Reset "w_skipcol" if the topline length has become smaller to // such a degree that nothing will be visible anymore, accounting // for 'smoothscroll' <<< or 'listchars' "precedes" marker. -- cgit v1.2.3