changeset 13886:bbf5bdba4a80 v8.0.1814

patch 8.0.1814: crash with terminal window and with 'lazyredraw' set commit https://github.com/vim/vim/commit/a10ae5e323f4ebe6620869f4f9b0812b78090915 Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 11 20:48:29 2018 +0200 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().
author Christian Brabandt <cb@256bit.org>
date Fri, 11 May 2018 21:00:06 +0200
parents d1c816cee4d2
children f5a2d0eb9926
files src/terminal.c src/version.c
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -38,6 +38,9 @@
  * in tl_scrollback are no longer used.
  *
  * 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()
  *   is disabled.
  * - Win32: Redirecting output works but includes escape sequences.
@@ -971,7 +974,10 @@ write_to_term(buf_T *buffer, char_u *msg
 	if (buffer == curbuf)
 	{
 	    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
 	    redraw_after_callback(TRUE);
@@ -2100,6 +2106,10 @@ terminal_loop(int blocking)
 	    while (must_redraw != 0)
 		if (update_screen(0) == FAIL)
 		    break;
+	if (!term_use_loop_check(TRUE))
+	    /* job finished while redrawing */
+	    break;
+
 	update_cursor(curbuf->b_term, FALSE);
 	restore_cursor = TRUE;
 
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1814,
+/**/
     1813,
 /**/
     1812,