1
0
forked from aniani/vim

patch 8.0.1814: crash with terminal window and with 'lazyredraw' set

Problem:    Crash with terminal window and with 'lazyredraw' set. (Antoine)
Solution:   Check the terminal still exists after update_screen().
This commit is contained in:
Bram Moolenaar
2018-05-11 20:48:29 +02:00
parent 38623c8512
commit a10ae5e323
2 changed files with 13 additions and 1 deletions

View File

@@ -38,6 +38,9 @@
* in tl_scrollback are no longer used. * in tl_scrollback are no longer used.
* *
* TODO: * TODO:
* - Win32: Termdebug doesn't work, because gdb does not support mi2. This
* plugin: https://github.com/cpiger/NeoDebug runs gdb as a job, redirecting
* input and output. Command I/O is in gdb window.
* - Win32: Redirecting input does not work, half of Test_terminal_redir_file() * - Win32: Redirecting input does not work, half of Test_terminal_redir_file()
* is disabled. * is disabled.
* - Win32: Redirecting output works but includes escape sequences. * - Win32: Redirecting output works but includes escape sequences.
@@ -971,7 +974,10 @@ write_to_term(buf_T *buffer, char_u *msg, channel_T *channel)
if (buffer == curbuf) if (buffer == curbuf)
{ {
update_screen(0); update_screen(0);
update_cursor(term, TRUE); /* update_screen() can be slow, check the terminal wasn't closed
* already */
if (buffer == curbuf && curbuf->b_term != NULL)
update_cursor(curbuf->b_term, TRUE);
} }
else else
redraw_after_callback(TRUE); redraw_after_callback(TRUE);
@@ -2100,6 +2106,10 @@ terminal_loop(int blocking)
while (must_redraw != 0) while (must_redraw != 0)
if (update_screen(0) == FAIL) if (update_screen(0) == FAIL)
break; break;
if (!term_use_loop_check(TRUE))
/* job finished while redrawing */
break;
update_cursor(curbuf->b_term, FALSE); update_cursor(curbuf->b_term, FALSE);
restore_cursor = TRUE; restore_cursor = TRUE;

View File

@@ -761,6 +761,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1814,
/**/ /**/
1813, 1813,
/**/ /**/