diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-02-06 04:12:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-06 04:12:14 +0100 |
commit | 12044218887264a885fdf4c7469e68d980c5d738 (patch) | |
tree | 132233232079d2812016b6f7cfe6933c9ea93cb4 /src | |
parent | aaa8c3d7112ab29de8b6c61b68bdee254cc0a1e6 (diff) | |
download | rneovim-12044218887264a885fdf4c7469e68d980c5d738.tar.gz rneovim-12044218887264a885fdf4c7469e68d980c5d738.tar.bz2 rneovim-12044218887264a885fdf4c7469e68d980c5d738.zip |
:terminal : set topline based on window height #8325
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/terminal.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index f715344689..7923db1302 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -1304,8 +1304,6 @@ static void redraw(bool restore_cursor) static void adjust_topline(Terminal *term, buf_T *buf, long added) { - int height, width; - vterm_get_size(term->vt, &height, &width); FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { if (wp->w_buffer == buf) { linenr_T ml_end = buf->b_ml.ml_line_count; @@ -1314,7 +1312,7 @@ static void adjust_topline(Terminal *term, buf_T *buf, long added) if (following || (wp == curwin && is_focused(term))) { // "Follow" the terminal output wp->w_cursor.lnum = ml_end; - set_topline(wp, MAX(wp->w_cursor.lnum - height + 1, 1)); + set_topline(wp, MAX(wp->w_cursor.lnum - wp->w_height + 1, 1)); } else { // Ensure valid cursor for each window displaying this terminal. wp->w_cursor.lnum = MIN(wp->w_cursor.lnum, ml_end); |