aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorShougo <Shougo.Matsu@gmail.com>2022-07-01 10:59:50 +0900
committerGitHub <noreply@github.com>2022-06-30 18:59:50 -0700
commit5a490d838ed3288abcf45e16e6ab79c326a67c17 (patch)
treed6084fc7aec13c4324404bb0886ad907c8446ed3 /src/nvim/window.c
parent3b1423bfa7adc5381af641a6e66fa2ca385ecab4 (diff)
downloadrneovim-5a490d838ed3288abcf45e16e6ab79c326a67c17.tar.gz
rneovim-5a490d838ed3288abcf45e16e6ab79c326a67c17.tar.bz2
rneovim-5a490d838ed3288abcf45e16e6ab79c326a67c17.zip
cmdheight=0: fix bugs #18961
Continue of #16251 Fix #18953 Fix #18960 Fix #18958 Fix #18955 Fix #18970 Fix #18983 Fix #18995 Fix #19112
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 9b9a2126ff..9ac027d80f 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -5560,9 +5560,10 @@ static void frame_setheight(frame_T *curfrp, int height)
if (curfrp->fr_parent == NULL) {
// topframe: can only change the command line
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 = MIN(ROWS_AVAIL + (p_ch - 1), height);
+ // 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 = MIN((p_ch > 0 ? ROWS_AVAIL + (p_ch - 1) : ROWS_AVAIL), height);
}
if (height > 0) {
frame_new_height(curfrp, height, false, false);