From c2375efe56b3918f83ee143f48fb7a763fa50289 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 12 Feb 2023 17:32:49 +0800 Subject: fix(ui): make sure screen is valid after resizing Problem: When not inside an Ex command, screen_resize() calls update_screen(), which calls screenclear() and set the screen as valid. However, when inside an Ex command, redrawing is postponed so update_screen() screen doesn't do anything, and the screen is still invalid after the resize, causing ui_comp_raw_line() to be no-op until update_screen() is called on the main loop. Solution: Restore the call to screenclear() inside screen_resize() so that the screen is invalid after screen_resize(). Since screenclear() changes redraw type from UPD_CLEAR to UPD_NOT_VALID, it is called at most once for each resize, so this shouldn't change how much code is run in the common (not inside an Ex command) case. --- src/nvim/drawscreen.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index 2bc335a7e0..814d443031 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -318,6 +318,10 @@ void screen_resize(int width, int height) resizing_autocmd = false; redraw_all_later(UPD_CLEAR); + if (State != MODE_ASKMORE && State != MODE_EXTERNCMD && State != MODE_CONFIRM) { + screenclear(); + } + if (starting != NO_SCREEN) { maketitle(); -- cgit