aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-06-25 06:43:26 +0200
committerJames McCoy <jamessan@jamessan.com>2017-08-16 10:39:50 -0400
commitf0a9b7ff637b1c33988b8ec20530657ba71644fc (patch)
treed981bdfbb92ba6e8c0cd67e1263b5139f9c8e536 /src/nvim/window.c
parent30cb66e8ba520d4564189ff763b5859e3d80581f (diff)
downloadrneovim-f0a9b7ff637b1c33988b8ec20530657ba71644fc.tar.gz
rneovim-f0a9b7ff637b1c33988b8ec20530657ba71644fc.tar.bz2
rneovim-f0a9b7ff637b1c33988b8ec20530657ba71644fc.zip
vim-patch:8.0.0678 closing a window does not trigger resizing
Closes #6748 Problem: When 'equalalways' is set and closing a window in a separate frame, not all window sizes are adjusted. (Glacambre) Solution: Resize all windows if the new current window is not in the same frame as the closed window. (closes vim/vim#1707) https://github.com/vim/vim/commit/8eeeba8c025ff844e6514c4a60cec11bf1fc1b35
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index faf5bceb56..6a21844812 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -1878,6 +1878,7 @@ int win_close(win_T *win, int free_buf)
int dir;
int help_window = FALSE;
tabpage_T *prev_curtab = curtab;
+ frame_T *win_frame = win->w_frame;
if (last_window()) {
EMSG(_("E444: Cannot close last window"));
@@ -2027,7 +2028,9 @@ int win_close(win_T *win, int free_buf)
check_cursor();
}
if (p_ea && (*p_ead == 'b' || *p_ead == dir)) {
- win_equal(curwin, true, dir);
+ // If the frame of the closed window contains the new current window,
+ // only resize that frame. Otherwise resize all windows.
+ win_equal(curwin, curwin->w_frame->fr_parent == win_frame->fr_parent, dir);
} else {
win_comp_pos();
}