aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2022-12-29 03:07:49 +0100
committerLuuk van Baal <luukvbaal@gmail.com>2022-12-31 00:30:53 +0100
commitb102bf22c009d3543f71d9d21c1252b54f5d4a54 (patch)
treeec658129951bd87d1db5b89a6e2ce782ffb40bf4 /src/nvim/window.c
parent05b6dd6e5f543083ebca581506398a8c263a2db6 (diff)
downloadrneovim-b102bf22c009d3543f71d9d21c1252b54f5d4a54.tar.gz
rneovim-b102bf22c009d3543f71d9d21c1252b54f5d4a54.tar.bz2
rneovim-b102bf22c009d3543f71d9d21c1252b54f5d4a54.zip
fix(ui): allow resize commands to set 'cmdheight' to 0
Resolve https://github.com/neovim/neovim/issues/21558
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index fe771c52c6..5c1c861f45 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -5758,8 +5758,8 @@ static void frame_setheight(frame_T *curfrp, int height)
if (height > ROWS_AVAIL) {
// If height is greater than the available space, try to create space for
// the frame by reducing 'cmdheight' if possible, while making sure
- // `cmdheight` doesn't go below 1.
- height = (int)MIN((p_ch > 0 ? ROWS_AVAIL + (p_ch - 1) : ROWS_AVAIL), height);
+ // `cmdheight` doesn't go below 1 if it wasn't set to 0 explicitly.
+ height = (int)MIN(ROWS_AVAIL + p_ch - !p_ch_was_zero, height);
}
if (height > 0) {
frame_new_height(curfrp, height, false, false);
@@ -6090,8 +6090,6 @@ void win_setminwidth(void)
/// Status line of dragwin is dragged "offset" lines down (negative is up).
void win_drag_status_line(win_T *dragwin, int offset)
{
- static bool p_ch_was_zero = false;
-
// If the user explicitly set 'cmdheight' to zero, then allow for dragging
// the status line making it zero again.
if (p_ch == 0) {