# HG changeset patch # User Bram Moolenaar # Date 1665053105 -7200 # Node ID 15ac28c12c8f5bd2a39b34581e2fc069a2fc66ca # Parent 069c5155439be60b6db6f14e83879b78433af409 patch 9.0.0670: no space for command line when there is a tabline Commit: https://github.com/vim/vim/commit/c9f5f73206272ccad0aa536854debc5f9781978a Author: Bram Moolenaar Date: Thu Oct 6 11:39:06 2022 +0100 patch 9.0.0670: no space for command line when there is a tabline Problem: No space for command line when there is a tabline. Solution: Correct computation of where the command line should be. (closes #11295) diff --git a/src/option.c b/src/option.c --- a/src/option.c +++ b/src/option.c @@ -3577,7 +3577,8 @@ set_num_option( // 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) + if ((p_ch != old_value + || tabline_height() + topframe->fr_height != Rows - p_ch) && full_screen #ifdef FEAT_GUI && !gui.starting diff --git a/src/testdir/dumps/Test_cmdheight_tabline_1.dump b/src/testdir/dumps/Test_cmdheight_tabline_1.dump new file mode 100644 --- /dev/null +++ b/src/testdir/dumps/Test_cmdheight_tabline_1.dump @@ -0,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 diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -287,6 +287,16 @@ func Test_changing_cmdheight() 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 \\"\", 'xt') call assert_equal('"map ', getreg(':')) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -700,6 +700,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 670, +/**/ 669, /**/ 668, diff --git a/src/window.c b/src/window.c --- a/src/window.c +++ b/src/window.c @@ -4332,7 +4332,7 @@ enter_tabpage( // When cmdheight is changed in a tab page with '-', 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)) + 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,7 +6665,7 @@ command_height(void) return; // Update cmdline_row to what it should be: just below the last window. - cmdline_row = topframe->fr_height; + 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