aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorMichael Ennen <mike.ennen@gmail.com>2016-12-02 16:04:47 -0700
committerMichael Ennen <mike.ennen@gmail.com>2016-12-02 16:04:47 -0700
commit9af8cd768d79e226d494d9387463cf9d8c35e0af (patch)
tree7b4bc54c1487b875c36e634eef228e68fefa66b5 /src/nvim/window.c
parent3607e0b8ff772683668127b92a841a57f8412ebc (diff)
downloadrneovim-9af8cd768d79e226d494d9387463cf9d8c35e0af.tar.gz
rneovim-9af8cd768d79e226d494d9387463cf9d8c35e0af.tar.bz2
rneovim-9af8cd768d79e226d494d9387463cf9d8c35e0af.zip
vim-patch:7.4.1835
Problem: When splitting and closing a window the status height changes. Solution: Compute the frame height correctly. (Hirohito Higashi) https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c26
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))