changeset 12092:bf3a61119baf v8.0.0926

patch 8.0.0926: when job in terminal window ends topline is wrong commit https://github.com/vim/vim/commit/e0f314aa8d0e2099d2e4e5665fe13199752adc8e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 13 16:01:31 2017 +0200 patch 8.0.0926: when job in terminal window ends topline is wrong Problem: When job in terminal window ends topline may be wrong. Solution: When the job ends adjust topline so that the active part of the terminal is displayed.
author Christian Brabandt <cb@256bit.org>
date Sun, 13 Aug 2017 16:15:04 +0200
parents b3dff741a6a9
children 02d8dba62a63
files src/terminal.c src/version.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -926,6 +926,13 @@ move_terminal_to_buffer(term_T *term)
 	    wp->w_cursor.lnum = term->tl_buffer->b_ml.ml_line_count;
 	    wp->w_cursor.col = 0;
 	    wp->w_valid = 0;
+	    if (wp->w_cursor.lnum >= wp->w_height)
+	    {
+		linenr_T min_topline = wp->w_cursor.lnum - wp->w_height + 1;
+
+		if (wp->w_topline < min_topline)
+		    wp->w_topline = min_topline;
+	    }
 	    redraw_win_later(wp, NOT_VALID);
 	}
     }
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    926,
+/**/
     925,
 /**/
     924,