From c1652bdcb5b5ca95b5ae328cec582f23816b70dd Mon Sep 17 00:00:00 2001 From: Shougo Date: Sun, 31 Jul 2022 14:13:19 +0900 Subject: cmdheight=0: fix bugs part2 (#19185) --- src/nvim/window.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/nvim/window.c') diff --git a/src/nvim/window.c b/src/nvim/window.c index b2812189d9..0bd84c0269 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -5877,7 +5877,7 @@ void win_setminheight(void) // loop until there is a 'winminheight' that is possible while (p_wmh > 0) { const int room = Rows - (int)p_ch; - const int needed = min_rows() - 1; // 1 was added for the cmdline + const int needed = min_rows(); if (room >= needed) { break; } @@ -6830,7 +6830,9 @@ int min_rows(void) } } total += tabline_height() + global_stl_height(); - total += 1; // count the room for the command line + if (p_ch > 0) { + total += 1; // count the room for the command line + } return total; } -- cgit