" :resize now also changes 'cmdheight' accordingly
call term_sendkeys(buf, ":set cmdheight+=1\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_2', {})
- call term_sendkeys(buf, ":set cmdheight-=1\<CR>")
" using more space moves the status line up
call term_sendkeys(buf, ":set cmdheight+=1\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_3', {})
" reducing cmdheight moves status line down
- call term_sendkeys(buf, ":set cmdheight-=2\<CR>")
+ call term_sendkeys(buf, ":set cmdheight-=3\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_4', {})
" reducing window size and then setting cmdheight
call term_sendkeys(buf, ":call EchoTwo()\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_6', {})
- " decreasing 'cmdheight' doesn't clear the messages that need hit-enter
+ " increasing 'cmdheight' doesn't clear the messages that need hit-enter
call term_sendkeys(buf, ":call EchoOne()\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_7', {})
+ " window commands do not reduce 'cmdheight' to value lower than :set by user
+ call term_sendkeys(buf, "\<CR>:wincmd _\<CR>")
+ call VerifyScreenDump(buf, 'Test_changing_cmdheight_8', {})
+
" clean up
call StopVimInTerminal(buf)
endfunc
return FALSE;
}
+// 'cmdheight' value explicitly set by the user: window commands are allowed to
+// resize the topframe to values higher than this minimum, but not lower.
+static int min_set_ch = 1;
+
/*
* Set a new height for a frame. Recursively sets the height for contained
* frames and windows. Caller must take care of positions.
if (topfrp->fr_parent == NULL && set_ch)
{
// topframe: update the command line height, with side effects.
- int new_ch = MAX(1, p_ch + topfrp->fr_height - height);
+ int new_ch = MAX(min_set_ch, p_ch + topfrp->fr_height - height);
+ int save_ch = min_set_ch;
if (new_ch != p_ch)
set_option_value((char_u *)"cmdheight", new_ch, NULL, 0);
+ min_set_ch = save_ch;
height = MIN(height, ROWS_AVAIL);
}
if (topfrp->fr_win != NULL)
old_p_ch += h;
frp = frp->fr_prev;
}
- if (p_ch < old_p_ch && command_frame_height)
+ if (p_ch < old_p_ch && command_frame_height && frp != NULL)
frame_add_height(frp, (int)(old_p_ch - p_ch));
// Recompute window positions.
// GUI starts up, we can't be sure in what order things happen. And when
// p_ch was changed in another tab page.
curtab->tp_ch_used = p_ch;
+ min_set_ch = p_ch;
}
/*