0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

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.
This commit is contained in:
Bram Moolenaar
2017-08-13 16:01:31 +02:00
parent 62426e168e
commit e0f314aa8d
2 changed files with 9 additions and 0 deletions

View 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);
}
}

View File

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