]> granicus.if.org Git - vim/commitdiff
patch 9.0.0670: no space for command line when there is a tabline v9.0.0670
authorBram Moolenaar <Bram@vim.org>
Thu, 6 Oct 2022 10:39:06 +0000 (11:39 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 6 Oct 2022 10:39:06 +0000 (11:39 +0100)
Problem:    No space for command line when there is a tabline.
Solution:   Correct computation of where the command line should be.
            (closes #11295)

src/option.c
src/testdir/dumps/Test_cmdheight_tabline_1.dump [new file with mode: 0644]
src/testdir/test_cmdline.vim
src/version.c
src/window.c

index 1b8c3eae8c6f93ec0df88ebf3d6cc7cd9b3e3b97..3cd1d4019ff8568ff970407290bbd4943db0c37e 100644 (file)
@@ -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 (file)
index 0000000..7260309
--- /dev/null
@@ -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
index 3cfdd7648070b942bb14d84b34c15486c2b00159..f27b0918cc805996b4e8410b3fe996d370ad6229 100644 (file)
@@ -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 <unique> <si\<Tab>\<Home>\"\<CR>", 'xt')
   call assert_equal('"map <unique> <silent>', getreg(':'))
index fa22ae540cece6046e950655261a271274d02119..a52b70791b79bbc34a355f2246a109050187d508 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    670,
 /**/
     669,
 /**/
index 1f3f9ad668d4ca5b65f42b2e5bedd6ac17d39ecb..f63b8564fbc9d2ed229585022d242f9dbc24ae19 100644 (file)
@@ -4332,7 +4332,7 @@ enter_tabpage(
     // 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))
+    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