Patch 9.0.0670
Problem: No space for command line when there is a tabline.
Solution: Correct computation of where the command line should be.
(closes #11295)
Files: src/option.c, src/window.c, src/testdir/test_cmdline.vim,
src/testdir/dumps/Test_cmdheight_tabline_1.dump
*** ../vim-9.0.0669/src/option.c 2022-10-05 15:42:11.646035846 +0100
--- src/option.c 2022-10-06 11:37:32.743086928 +0100
***************
*** 3577,3583 ****
// Only compute the new window layout when startup has been
// completed. Otherwise the frame sizes may be wrong.
! if ((p_ch != old_value || topframe->fr_height != Rows - p_ch)
&& full_screen
#ifdef FEAT_GUI
&& !gui.starting
--- 3577,3584 ----
// Only compute the new window layout when startup has been
// completed. Otherwise the frame sizes may be wrong.
! if ((p_ch != old_value
! || tabline_height() + topframe->fr_height != Rows - p_ch)
&& full_screen
#ifdef FEAT_GUI
&& !gui.starting
*** ../vim-9.0.0669/src/window.c 2022-10-05 18:25:26.937192709 +0100
--- src/window.c 2022-10-06 11:35:56.859319894 +0100
***************
*** 4332,4338 ****
// When cmdheight is changed in a tab page with '<C-w>-', cmdline_row is
// changed but p_ch and tp_ch_used are not changed. Thus we also need to
// check cmdline_row.
! if ((row < cmdline_row) && (cmdline_row <= Rows - p_ch))
clear_cmdline = TRUE;
// The tabpage line may have appeared or disappeared, may need to resize
--- 4332,4338 ----
// When cmdheight is changed in a tab page with '<C-w>-', cmdline_row is
// changed but p_ch and tp_ch_used are not changed. Thus we also need to
// check cmdline_row.
! if (row < cmdline_row && cmdline_row <= Rows - p_ch)
clear_cmdline = TRUE;
// The tabpage line may have appeared or disappeared, may need to resize
***************
*** 6665,6671 ****
return;
// Update cmdline_row to what it should be: just below the last window.
! cmdline_row = topframe->fr_height;
// 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
--- 6665,6671 ----
return;
// Update cmdline_row to what it should be: just below the last window.
! cmdline_row = topframe->fr_height + tabline_height();
// 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
*** ../vim-9.0.0669/src/testdir/test_cmdline.vim 2022-10-05 15:42:11.646035846 +0100
--- src/testdir/test_cmdline.vim 2022-10-06 11:31:32.119985817 +0100
***************
*** 287,292 ****
--- 287,302 ----
call StopVimInTerminal(buf)
endfunc
+ func Test_cmdheight_tabline()
+ CheckScreendump
+
+ let buf = RunVimInTerminal('-c "set ls=2" -c "set stal=2" -c "set cmdheight=1"', {'rows': 6})
+ call VerifyScreenDump(buf, 'Test_cmdheight_tabline_1', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ endfunc
+
func Test_map_completion()
call feedkeys(":map <unique> <si\<Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"map <unique> <silent>', getreg(':'))
*** ../vim-9.0.0669/src/testdir/dumps/Test_cmdheight_tabline_1.dump 2022-10-06 11:36:23.099255775 +0100
--- src/testdir/dumps/Test_cmdheight_tabline_1.dump 2022-10-06 11:31:40.919963010 +0100
***************
*** 0 ****
--- 1,6 ----
+ | +2&#ffffff0|[|N|o| |N|a|m|e|]| | +1&&@63
+ > +0&&@74
+ |~+0#4040ff13&| @73
+ |~| @73
+ |[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
+ | +0&&@74
*** ../vim-9.0.0669/src/version.c 2022-10-05 21:45:23.775124283 +0100
--- src/version.c 2022-10-06 11:33:02.111754980 +0100
***************
*** 701,702 ****
--- 701,704 ----
{ /* Add new patch number below this line */
+ /**/
+ 670,
/**/
--
Facepalm statement #6: "Estland is a fantasy place, just like Middle Earth and
Madagaskar"
/// Bram Moolenaar -- Br...@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 ///