aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/os/input.c6
-rw-r--r--src/nvim/screen.c11
2 files changed, 11 insertions, 6 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c
index f264a26939..5f0f2ec677 100644
--- a/src/nvim/os/input.c
+++ b/src/nvim/os/input.c
@@ -144,9 +144,15 @@ bool os_char_avail(void)
// Check for CTRL-C typed by reading all available characters.
void os_breakcheck(void)
{
+ int save_us = updating_screen;
+ // We do not want screen_resize() to redraw here.
+ updating_screen++;
+
if (!got_int) {
loop_poll_events(&main_loop, 0);
}
+
+ updating_screen = save_us;
}
void input_enable_events(void)
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 10a184ad5b..3823fb2a23 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -507,7 +507,7 @@ void update_single_line(win_T *wp, linenr_T lnum)
row += wp->w_lines[j].wl_size;
}
}
- need_cursor_line_redraw = FALSE;
+ need_cursor_line_redraw = false;
updating_screen = false;
}
@@ -7328,12 +7328,11 @@ void screen_resize(int width, int height)
{
static int busy = FALSE;
- /*
- * Avoid recursiveness, can happen when setting the window size causes
- * another window-changed signal.
- */
- if (busy)
+ // Avoid recursiveness, can happen when setting the window size causes
+ // another window-changed signal.
+ if (updating_screen || busy) {
return;
+ }
if (width < 0 || height < 0) /* just checking... */
return;