[vim/vim] Relax split restrictions when split-moving windows (PR #14109)

10 views
Skip to first unread message

Sean Dewar

unread,
Feb 28, 2024, 1:52:15 PM2/28/24
to vim/vim, Subscribed

Following up on my comment here, it seems unnecessary to check b_locked_split when "split-moving" windows. It looks like the flag exists to stop new views into a buffer being created while it's closing (which can result in windows into a freed buffer remaining), but split-moving doesn't result in any new views into a buffer, unlike regular splitting.

The doc comment for b_locked_split also seems to support this:
https://github.com/vim/vim/blob/0c98a71236e6eca983fed5d903d07bd53190d16b/src/structs.h#L3002-L3003

So, continue to check split_disallowed when split-moving (it looks possibly relevant), but add a test to check that split-moving is OK when b_locked_split is set (I've made sure it crashes Vim if the b_locked_split check is reverted for regular splitting).


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/14109

Commit Summary

  • 25475f9 Relax split restrictions when split-moving windows

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14109@github.com>

Christian Brabandt

unread,
Feb 29, 2024, 3:19:43 AM2/29/24
to vim/vim, Subscribed

actually, it seems to be a different issue (unrelated to 9.1.0143 or the issue it fixes); it seems close_buffer and its callers don't consider that autocmds can make another window view a buffer that's being wiped, without causing b->b_nwindows > 1.

Yeah the patch I made only addresses BufLeave autocommands, however the same can probably happen for other autocommands. We should try to make this more central.

Thanks


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14109/c1970630435@github.com>

Christian Brabandt

unread,
Jun 13, 2026, 4:17:14 PM (10 hours ago) Jun 13
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#14109)

this has stalled, so closing


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14109/c4699670105@github.com>

Sean Dewar

unread,
Jun 13, 2026, 8:07:43 PM (6 hours ago) Jun 13
to vim/vim, Subscribed
seandewar left a comment (vim/vim#14109)

No problem. I may revisit later as the b_nwindows bug that blocked this was likely fixed in #19728, but no ETA as I'm currently largely away from the computer due to an emergency. Best wishes in the meantime to all!


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14109/c4700175815@github.com>

Reply all
Reply to author
Forward
0 new messages