To: vim_dev@googlegroups.com Subject: Patch 8.2.2545 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.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) Files: src/terminal.c, src/testdir/test_terminal.vim *** ../vim-8.2.2544/src/terminal.c 2020-11-28 21:56:02.451507313 +0100 --- src/terminal.c 2021-02-23 17:39:21.823873507 +0100 *************** *** 3800,3805 **** --- 3800,3810 ---- 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; *** ../vim-8.2.2544/src/testdir/test_terminal.vim 2021-02-08 21:28:53.825440827 +0100 --- src/testdir/test_terminal.vim 2021-02-23 17:38:34.672025748 +0100 *************** *** 470,475 **** --- 470,488 ---- 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('$')) *** ../vim-8.2.2544/src/version.c 2021-02-23 12:05:40.914627816 +0100 --- src/version.c 2021-02-23 17:29:39.418012919 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2545, /**/ -- Veni, Vidi, VW -- I came, I saw, I drove around in a little car. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///