diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/screen.c | 3 | ||||
-rw-r--r-- | src/nvim/term.c | 6 | ||||
-rw-r--r-- | src/nvim/ui.c | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 52ded0aa49..5cfda13dbd 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -8188,6 +8188,9 @@ void screen_resize(int width, int height, int mustset) check_shellsize(); if (abstract_ui) { + // Clear the output buffer to ensure UIs don't receive redraw command meant + // for invalid screen sizes. + out_buf_clear(); ui_resize(width, height); } else { mch_set_shellsize(); diff --git a/src/nvim/term.c b/src/nvim/term.c index a1e13cfeb7..2dc4d68b19 100644 --- a/src/nvim/term.c +++ b/src/nvim/term.c @@ -1817,6 +1817,12 @@ void term_write(char_u *s, size_t len) static char_u out_buf[OUT_SIZE + 1]; static int out_pos = 0; /* number of chars in out_buf */ +// Clear the output buffer +void out_buf_clear(void) +{ + out_pos = 0; +} + /* * out_flush(): flush the output buffer */ diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 914b04111e..ef0386e395 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -173,7 +173,7 @@ void ui_refresh(void) return; } - width = height = INT_MAX; + int width = INT_MAX, height = INT_MAX; for (size_t i = 0; i < ui_count; i++) { UI *ui = uis[i]; |