From f0a9b7ff637b1c33988b8ec20530657ba71644fc Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 25 Jun 2017 06:43:26 +0200 Subject: 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 --- src/nvim/window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/nvim/window.c') 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(); } -- cgit From 1fb3339844b2244daaee9b44264137c8c6c67164 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 27 Jun 2017 02:32:08 +0200 Subject: vim-patch:8.0.0679 Problem: Using freed memory. Solution: Get the parent frame pointer earlier. https://github.com/vim/vim/commit/41cc038ff83498c589c7d25b3d2984145528eb92 --- src/nvim/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/window.c') diff --git a/src/nvim/window.c b/src/nvim/window.c index 6a21844812..081fc98816 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -1878,7 +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; + frame_T *win_frame = win->w_frame->fr_parent; if (last_window()) { EMSG(_("E444: Cannot close last window")); @@ -2030,7 +2030,7 @@ int win_close(win_T *win, int free_buf) if (p_ea && (*p_ead == 'b' || *p_ead == 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); + win_equal(curwin, curwin->w_frame->fr_parent == win_frame, dir); } else { win_comp_pos(); } -- cgit