diff src/window.c @ 20049:8c401bc7f32b v8.2.0580

patch 8.2.0580: window size wrong if 'ea' is off and 'splitright' is on Commit: https://github.com/vim/vim/commit/edd327cc070d9a05c12e88bc5c43a1e2a3086ae6 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 15 20:05:47 2020 +0200 patch 8.2.0580: window size wrong if 'ea' is off and 'splitright' is on Problem: Window size wrong if 'ea' is off and 'splitright' is on and splitting then closing a window. Solution: Put abandoned window space in the right place. (Mark Waggoner)
author Bram Moolenaar <Bram@vim.org>
date Wed, 15 Apr 2020 20:15:06 +0200
parents 435726a03481
children 06a1dd50463e
line wrap: on
line diff
--- a/src/window.c
+++ b/src/window.c
@@ -2967,9 +2967,22 @@ win_altframe(
     if (frp->fr_next == NULL)
 	return frp->fr_prev;
 
+    // By default the next window will get the space that was abandoned by this
+    // window
     target_fr = frp->fr_next;
     other_fr  = frp->fr_prev;
-    if (p_spr || p_sb)
+
+    // If this is part of a column of windows and 'splitbelow' is true then the
+    // previous window will get the space.
+    if (frp->fr_parent != NULL && frp->fr_parent->fr_layout == FR_COL && p_sb)
+    {
+	target_fr = frp->fr_prev;
+	other_fr  = frp->fr_next;
+    }
+
+    // If this is part of a row of windows, and 'splitright' is true then the
+    // previous window will get the space.
+    if (frp->fr_parent != NULL && frp->fr_parent->fr_layout == FR_ROW && p_spr)
     {
 	target_fr = frp->fr_prev;
 	other_fr  = frp->fr_next;