Merge pull request #6061 from justinmk/vim-ancient-bugs

vim-patch: fix some resize bugs
This commit is contained in:
James McCoy
2017-02-06 10:23:55 -05:00
committed by GitHub
2 changed files with 14 additions and 7 deletions

View File

@@ -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)

View File

@@ -487,9 +487,10 @@ void update_single_line(win_T *wp, linenr_T lnum)
int j;
// Don't do anything if the screen structures are (not yet) valid.
if (!screen_valid(true)) {
if (!screen_valid(true) || updating_screen) {
return;
}
updating_screen = true;
if (lnum >= wp->w_topline && lnum < wp->w_botline
&& foldedCount(wp, lnum, &win_foldinfo) == 0) {
@@ -506,7 +507,8 @@ 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;
}
@@ -7326,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;