diff options
-rw-r--r-- | src/terminal.c | 5 | ||||
-rw-r--r-- | src/testdir/test_terminal.vim | 13 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/terminal.c b/src/terminal.c index 9729eac8f..4c43ea748 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -3800,6 +3800,11 @@ term_update_window(win_T *wp) newrows = rows == 0 ? newrows : minsize ? MAX(rows, newrows) : rows; newcols = cols == 0 ? newcols : minsize ? MAX(cols, newcols) : cols; + // If no cell is visible there is no point in resizing. Also, vterm can't + // handle a zero height. + if (newrows == 0 || newcols == 0) + return; + if (term->tl_rows != newrows || term->tl_cols != newcols) { term->tl_vterm_size_changed = TRUE; diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 90241710e..3def03d7b 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -470,6 +470,19 @@ func Test_terminal_size() call delete('Xtext') endfunc +func Test_terminal_zero_height() + split + wincmd j + anoremenu 1.1 WinBar.test : + terminal ++curwin + wincmd k + wincmd _ + redraw + + call term_sendkeys(bufnr(), "exit\r") + bwipe! +endfunc + func Test_terminal_curwin() let cmd = Get_cat_123_cmd() call assert_equal(1, winnr('$')) diff --git a/src/version.c b/src/version.c index aa6d34380..dda530a3f 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2545, +/**/ 2544, /**/ 2543, |