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
@@ -3800,6 +3800,11 @@ | ||
3800 | 3800 | newrows = rows == 0 ? newrows : minsize ? MAX(rows, newrows) : rows; |
3801 | 3801 | newcols = cols == 0 ? newcols : minsize ? MAX(cols, newcols) : cols; |
3802 | 3802 | |
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 | + | |
3803 | 3808 | if (term->tl_rows != newrows || term->tl_cols != newcols) |
3804 | 3809 | { |
3805 | 3810 | term->tl_vterm_size_changed = TRUE; |
@@ -470,6 +470,19 @@ | ||
470 | 470 | call delete('Xtext') |
471 | 471 | endfunc |
472 | 472 | |
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 | + | |
473 | 486 | func Test_terminal_curwin() |
474 | 487 | let cmd = Get_cat_123_cmd() |
475 | 488 | call assert_equal(1, winnr('$')) |
@@ -751,6 +751,8 @@ | ||
751 | 751 | static int included_patches[] = |
752 | 752 | { /* Add new patch number below this line */ |
753 | 753 | /**/ |
754 | + 2545, | |
755 | +/**/ | |
754 | 756 | 2544, |
755 | 757 | /**/ |
756 | 758 | 2543, |