To: vim_dev@googlegroups.com Subject: Patch 9.0.0191 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0191 (after 9.0.0190) Problem: Messages test fails; window size incorrect when 'cmdheight' is made smaller. Solution: Properly cleanup after test with cmdheight zero. Resize windows correctly when 'cmdheight' gets smaller. Files: src/window.c, src/testdir/test_messages.vim, src/testdir/test_cmdline.vim, src/testdir/dumps/Test_changing_cmdheight_5.dump *** ../vim-9.0.0190/src/window.c 2022-08-11 13:16:59.815013566 +0100 --- src/window.c 2022-08-11 14:12:43.802834852 +0100 *************** *** 6555,6560 **** --- 6555,6566 ---- if (p_ch > old_p_ch && cmdline_row <= Rows - p_ch) return; + // If cmdline_row is smaller than what it is supposed to be for 'cmdheight' + // then set old_p_ch to what it would be, so that the windows get resized + // properly for the new value. + if (cmdline_row < Rows - p_ch) + old_p_ch = Rows - cmdline_row; + // Find bottom frame with width of screen. frp = lastwin->w_frame; while (frp->fr_width != Columns && frp->fr_parent != NULL) *** ../vim-9.0.0190/src/testdir/test_messages.vim 2022-07-31 11:37:16.451058499 +0100 --- src/testdir/test_messages.vim 2022-08-11 14:01:34.020110015 +0100 *************** *** 388,393 **** --- 388,394 ---- endfunc func Test_cmdheight_zero() + enew set cmdheight=0 set showcmd redraw! *************** *** 437,446 **** 7 call feedkeys(":\"\=line('w0')\\", "xt") call assert_equal('"1', @:) - bwipe! set cmdheight& set showcmd& endfunc " vim: shiftwidth=2 sts=2 expandtab --- 438,450 ---- 7 call feedkeys(":\"\=line('w0')\\", "xt") call assert_equal('"1', @:) + bwipe! + bwipe! set cmdheight& set showcmd& + tabnew + tabonly endfunc " vim: shiftwidth=2 sts=2 expandtab *** ../vim-9.0.0190/src/testdir/test_cmdline.vim 2022-08-11 13:16:59.815013566 +0100 --- src/testdir/test_cmdline.vim 2022-08-11 14:10:53.771036272 +0100 *************** *** 239,244 **** --- 239,249 ---- call term_sendkeys(buf, ":set cmdheight-=2\") call VerifyScreenDump(buf, 'Test_changing_cmdheight_4', {}) + " reducing window size and then setting cmdheight + call term_sendkeys(buf, ":resize -1\") + call term_sendkeys(buf, ":set cmdheight=1\") + call VerifyScreenDump(buf, 'Test_changing_cmdheight_5', {}) + " clean up call StopVimInTerminal(buf) call delete('XTest_cmdheight') *** ../vim-9.0.0190/src/testdir/dumps/Test_changing_cmdheight_5.dump 2022-08-11 14:12:58.394808287 +0100 --- src/testdir/dumps/Test_changing_cmdheight_5.dump 2022-08-11 14:10:59.587025571 +0100 *************** *** 0 **** --- 1,8 ---- + > +0&#ffffff0@74 + |~+0#4040ff13&| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 + | +0&&@74 *** ../vim-9.0.0190/src/version.c 2022-08-11 13:16:59.815013566 +0100 --- src/version.c 2022-08-11 14:02:44.519968198 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 191, /**/ -- FIRST HEAD: All right! All right! We'll kill him first and then have tea and biscuits. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///