cmdheight=0: fix bugs #18961

Continue of #16251

Fix #18953
Fix #18960
Fix #18958
Fix #18955
Fix #18970
Fix #18983
Fix #18995
Fix #19112
This commit is contained in:
Shougo
2022-07-01 10:59:50 +09:00
committed by GitHub
parent 3b1423bfa7
commit 5a490d838e
7 changed files with 106 additions and 12 deletions

View File

@@ -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);