diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-12 17:32:49 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-02-13 08:50:54 +0800 |
commit | c2375efe56b3918f83ee143f48fb7a763fa50289 (patch) | |
tree | daad56914e77d3bb679fc587f21d7bbb6abbae08 /src | |
parent | 5d3769ea2343a30c60963011bef85346320bd97c (diff) | |
download | rneovim-c2375efe56b3918f83ee143f48fb7a763fa50289.tar.gz rneovim-c2375efe56b3918f83ee143f48fb7a763fa50289.tar.bz2 rneovim-c2375efe56b3918f83ee143f48fb7a763fa50289.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/drawscreen.c | 4 |
1 files changed, 4 insertions, 0 deletions
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(); |