diff options
| author | Bram Moolenaar <Bram@vim.org> | 2017-08-13 16:01:31 +0200 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2017-08-13 16:01:31 +0200 |
| commit | e0f314aa8d0e2099d2e4e5665fe13199752adc8e (patch) | |
| tree | 11c555b624985a0dac4df4a1147eb3200af82560 /src/terminal.c | |
| parent | 62426e168ef29fb941d1bd91a112fa09445322a5 (diff) | |
| download | vim-git-e0f314aa8d0e2099d2e4e5665fe13199752adc8e.tar.gz | |
patch 8.0.0926: when job in terminal window ends topline is wrongv8.0.0926
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.
Diffstat (limited to 'src/terminal.c')
| -rw-r--r-- | src/terminal.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/terminal.c b/src/terminal.c index b98398bd9..9115ac3b5 100644 --- 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); } } |
