mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 01:08:20 +00:00
ui: Fix redraw bug caused by race conditions with remote clients
Before sending a resize command to the UIs, flush the current output buffer to ensure no redraw commands for a screen with invalid size are processed.
This commit is contained in:
@@ -8188,6 +8188,9 @@ void screen_resize(int width, int height, int mustset)
|
|||||||
check_shellsize();
|
check_shellsize();
|
||||||
|
|
||||||
if (abstract_ui) {
|
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);
|
ui_resize(width, height);
|
||||||
} else {
|
} else {
|
||||||
mch_set_shellsize();
|
mch_set_shellsize();
|
||||||
|
@@ -1817,6 +1817,12 @@ void term_write(char_u *s, size_t len)
|
|||||||
static char_u out_buf[OUT_SIZE + 1];
|
static char_u out_buf[OUT_SIZE + 1];
|
||||||
static int out_pos = 0; /* number of chars in out_buf */
|
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
|
* out_flush(): flush the output buffer
|
||||||
*/
|
*/
|
||||||
|
@@ -173,7 +173,7 @@ void ui_refresh(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
width = height = INT_MAX;
|
int width = INT_MAX, height = INT_MAX;
|
||||||
|
|
||||||
for (size_t i = 0; i < ui_count; i++) {
|
for (size_t i = 0; i < ui_count; i++) {
|
||||||
UI *ui = uis[i];
|
UI *ui = uis[i];
|
||||||
|
Reference in New Issue
Block a user