This seems to work better:
diff --git i/src/window.c w/src/window.c
index 7efe7b164..e28955d1b 100644
--- i/src/window.c
+++ w/src/window.c
@@ -2967,10 +2967,18 @@ 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 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 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;
}
On Tuesday, April 14, 2020 at 10:23:01 AM UTC-7, Mark Waggoner wrote:
>
> If you have splitright and noequalalways set, when you split a window
> (normal horizontal split, not vertical split), the split will appear above
> the current window.
> When you close the split window, the space is restored to the window
> ABOVE, not back to the window below.
>
> I can see that this is intentionally done in window.c:
> /*
> * Return a pointer to the frame that will receive the empty screen space
> that
> * is left over after "win" is closed.
> *
> * If 'splitbelow' or 'splitright' is set, the space goes above or to the
> left
> * by default. Otherwise, the free space goes below or to the right. The
> * result is that opening a window and then immediately closing it will
> * preserve the initial window layout. The 'wfh' and 'wfw' settings are
> * respected when possible.
> */
> static frame_T *
> win_altframe(
>
> Is there some way to have this be a little more intelligent about where
> the window space is restored?
>
> Mark Waggoner
>
>
>
>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/53c69971-e21c-4f4f-a087-aa75cd3d1755%40googlegroups.com.