diff options
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r-- | src/nvim/window.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index 8512556c0a..dac3c1614a 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -894,31 +894,31 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir) /* "new_size" of the current window goes to the new window, use * one row for the status line */ win_new_height(wp, new_size); - if (flags & (WSP_TOP | WSP_BOT)) - frame_new_height(curfrp, curfrp->fr_height - - (new_size + STATUS_HEIGHT), flags & WSP_TOP, FALSE); - else + if (flags & (WSP_TOP | WSP_BOT)) { + int new_fr_height = curfrp->fr_height - new_size; + + if (!((flags & WSP_BOT) && p_ls == 0)) { + new_fr_height -= STATUS_HEIGHT; + } + frame_new_height(curfrp, new_fr_height, flags & WSP_TOP, false); + } else { win_new_height(oldwin, oldwin_height - (new_size + STATUS_HEIGHT)); - if (before) { /* new window above current one */ + } + if (before) { // new window above current one wp->w_winrow = oldwin->w_winrow; wp->w_status_height = STATUS_HEIGHT; oldwin->w_winrow += wp->w_height + STATUS_HEIGHT; } else { /* new window below current one */ wp->w_winrow = oldwin->w_winrow + oldwin->w_height + STATUS_HEIGHT; wp->w_status_height = oldwin->w_status_height; - // Don't set the status_height for oldwin yet, this might break - // frame_fix_height(oldwin), therefore will be set below. + if (!(flags & WSP_BOT)) { + oldwin->w_status_height = STATUS_HEIGHT; + } } if (flags & WSP_BOT) frame_add_statusline(curfrp); frame_fix_height(wp); frame_fix_height(oldwin); - - if (!before) { - // New window above current one, set the status_height after - // frame_fix_height(oldwin) - oldwin->w_status_height = STATUS_HEIGHT; - } } if (flags & (WSP_TOP | WSP_BOT)) |