aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 7225cfb9c7..ff147e22df 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -5555,7 +5555,6 @@ 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
@@ -5877,7 +5876,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;
}
@@ -6307,7 +6306,8 @@ void win_set_inner_size(win_T *wp)
// There is no point in adjusting the scroll position when exiting. Some
// values might be invalid.
- if (!exiting) {
+ // Skip scroll_to_fraction() when 'cmdheight' was set to one from zero.
+ if (!exiting && !made_cmdheight_nonzero) {
scroll_to_fraction(wp, prev_height);
}
redraw_later(wp, NOT_VALID); // SOME_VALID??
@@ -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;
}