diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-02-23 17:47:23 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-02-23 17:47:23 +0100 |
commit | eba13e4ea28f133ff65f6b426428f49a9bd711b0 (patch) | |
tree | 81eb39f4c0abe6ea3e988046fcf56941943c514f /src/terminal.c | |
parent | bc327ccc3dd408463fc74266f57b879888a13e51 (diff) | |
download | vim-git-eba13e4ea28f133ff65f6b426428f49a9bd711b0.tar.gz |
patch 8.2.2545: errors and crash when terminal window is zero heightv8.2.2545
Problem: Errors and crash when terminal window is zero height. (Leonid V.
Fedorenchik)
Solution: Do not resize when width or height is zero. (closes #7890)
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 5 |
1 files changed, 5 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; |