diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-12 20:28:01 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-02-12 20:28:01 +0100 |
commit | f2d90a351159fd6843f450850f52004f42e00183 (patch) | |
tree | b568a8b2eaf3cc33bba3af800c14f613b2b18cc3 /src/change.c | |
parent | a0010a186d93187d2b69b857d75db8a1e01049bb (diff) |
patch 9.1.0100: Redrawing can be improved with undo and 'spell'v9.1.0100
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 <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/change.c')
-rw-r--r-- | src/change.c | 6 |
1 files changed, 6 insertions, 0 deletions
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. |