• R/O
  • SSH

vim: コミット

Mirror of the Vim source from https://github.com/vim/vim


コミットメタ情報

リビジョンd9afd90089104d82a82ba241b2f7094dcc9f00d2 (tree)
日時2021-02-24 02:00:03
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

patch 8.2.2545: errors and crash when terminal window is zero height

Commit: https://github.com/vim/vim/commit/eba13e4ea28f133ff65f6b426428f49a9bd711b0
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 23 17:47:23 2021 +0100

patch 8.2.2545: errors and crash when terminal window is zero height
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)

変更サマリ

差分

diff -r 5f605f9903dd -r d9afd9008910 src/terminal.c
--- a/src/terminal.c Tue Feb 23 12:15:04 2021 +0100
+++ b/src/terminal.c Tue Feb 23 18:00:03 2021 +0100
@@ -3800,6 +3800,11 @@
38003800 newrows = rows == 0 ? newrows : minsize ? MAX(rows, newrows) : rows;
38013801 newcols = cols == 0 ? newcols : minsize ? MAX(cols, newcols) : cols;
38023802
3803+ // If no cell is visible there is no point in resizing. Also, vterm can't
3804+ // handle a zero height.
3805+ if (newrows == 0 || newcols == 0)
3806+ return;
3807+
38033808 if (term->tl_rows != newrows || term->tl_cols != newcols)
38043809 {
38053810 term->tl_vterm_size_changed = TRUE;
diff -r 5f605f9903dd -r d9afd9008910 src/testdir/test_terminal.vim
--- a/src/testdir/test_terminal.vim Tue Feb 23 12:15:04 2021 +0100
+++ b/src/testdir/test_terminal.vim Tue Feb 23 18:00:03 2021 +0100
@@ -470,6 +470,19 @@
470470 call delete('Xtext')
471471 endfunc
472472
473+func Test_terminal_zero_height()
474+ split
475+ wincmd j
476+ anoremenu 1.1 WinBar.test :
477+ terminal ++curwin
478+ wincmd k
479+ wincmd _
480+ redraw
481+
482+ call term_sendkeys(bufnr(), "exit\r")
483+ bwipe!
484+endfunc
485+
473486 func Test_terminal_curwin()
474487 let cmd = Get_cat_123_cmd()
475488 call assert_equal(1, winnr('$'))
diff -r 5f605f9903dd -r d9afd9008910 src/version.c
--- a/src/version.c Tue Feb 23 12:15:04 2021 +0100
+++ b/src/version.c Tue Feb 23 18:00:03 2021 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 2545,
755+/**/
754756 2544,
755757 /**/
756758 2543,
旧リポジトリブラウザで表示