vim-patch:8.0.0275

Problem:    When checking for CTRL-C typed the GUI may detect a screen resize
            and redraw the screen, causing trouble.
Solution:   Set updating_screen in ui_breakcheck().

e3caa11090
This commit is contained in:
Justin M. Keyes
2017-02-04 18:54:55 +01:00
parent 1ec52b893a
commit b77cad183d
2 changed files with 11 additions and 6 deletions

View File

@@ -144,9 +144,15 @@ bool os_char_avail(void)
// Check for CTRL-C typed by reading all available characters. // Check for CTRL-C typed by reading all available characters.
void os_breakcheck(void) void os_breakcheck(void)
{ {
int save_us = updating_screen;
// We do not want screen_resize() to redraw here.
updating_screen++;
if (!got_int) { if (!got_int) {
loop_poll_events(&main_loop, 0); loop_poll_events(&main_loop, 0);
} }
updating_screen = save_us;
} }
void input_enable_events(void) void input_enable_events(void)

View File

@@ -507,7 +507,7 @@ void update_single_line(win_T *wp, linenr_T lnum)
row += wp->w_lines[j].wl_size; row += wp->w_lines[j].wl_size;
} }
} }
need_cursor_line_redraw = FALSE; need_cursor_line_redraw = false;
updating_screen = false; updating_screen = false;
} }
@@ -7328,12 +7328,11 @@ void screen_resize(int width, int height)
{ {
static int busy = FALSE; static int busy = FALSE;
/* // Avoid recursiveness, can happen when setting the window size causes
* Avoid recursiveness, can happen when setting the window size causes // another window-changed signal.
* another window-changed signal. if (updating_screen || busy) {
*/
if (busy)
return; return;
}
if (width < 0 || height < 0) /* just checking... */ if (width < 0 || height < 0) /* just checking... */
return; return;