]> granicus.if.org Git - vim/commitdiff
patch 8.0.0926: when job in terminal window ends topline is wrong v8.0.0926
authorBram Moolenaar <Bram@vim.org>
Sun, 13 Aug 2017 14:01:31 +0000 (16:01 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 13 Aug 2017 14:01:31 +0000 (16:01 +0200)
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.

src/terminal.c
src/version.c

index b98398bd96b5c3fe9e75a75901805822a7539c51..9115ac3b5ace97e64e10787e5a3664697fd27adc 100644 (file)
@@ -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);
        }
     }
index 67e96e6152574eb7d2dd1067fa370f328e599c9b..00aedcec67ce909ecef0824c037a50fa14d3becf 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    926,
 /**/
     925,
 /**/