aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-04-05 19:34:06 +0200
committerGitHub <noreply@github.com>2022-04-05 19:34:06 +0200
commit402a71ff87baf6f68d9dae6f5faa2b49f2d9045f (patch)
treefadae2b5774a1f429247cc144580bd298d272446 /src/nvim/window.c
parent969d600f2a107507c60e4ac3f3a8c03210662f96 (diff)
parent6dc31eea438d4ebda06f625b0b656882c806570c (diff)
downloadrneovim-402a71ff87baf6f68d9dae6f5faa2b49f2d9045f.tar.gz
rneovim-402a71ff87baf6f68d9dae6f5faa2b49f2d9045f.tar.bz2
rneovim-402a71ff87baf6f68d9dae6f5faa2b49f2d9045f.zip
Merge pull request #17335 from famiu/fix/ui/win-resize
fix: Make window resize commands manage cmdheight
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 9ac51bb108..cc21bf25b0 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -5412,11 +5412,17 @@ void win_setheight_win(int height, win_T *win)
// line, clear it.
if (full_screen && msg_scrolled == 0 && row < cmdline_row) {
grid_fill(&default_grid, row, cmdline_row, 0, Columns, ' ', ' ', 0);
+ if (msg_grid.chars) {
+ clear_cmdline = true;
+ }
}
cmdline_row = row;
+ p_ch = MAX(Rows - cmdline_row, 1);
+ curtab->tp_ch_used = p_ch;
msg_row = row;
msg_col = 0;
redraw_all_later(NOT_VALID);
+ showmode();
}
}
@@ -5452,7 +5458,9 @@ 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) {
- 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 > 0) {
frame_new_height(curfrp, height, false, false);