Skip to content

Use sensible provisional splits for other-window... commands (via split-window-sensibly)#97

Open
monkeyjunglejuice wants to merge 1 commit into
dimitri:masterfrom
monkeyjunglejuice:split-window-sensibly
Open

Use sensible provisional splits for other-window... commands (via split-window-sensibly)#97
monkeyjunglejuice wants to merge 1 commit into
dimitri:masterfrom
monkeyjunglejuice:split-window-sensibly

Conversation

@monkeyjunglejuice
Copy link
Copy Markdown
Contributor

@monkeyjunglejuice monkeyjunglejuice commented May 16, 2026

Use split-window-sensibly instead of hardcoding a right split in switch-window--then-other-window when there's just one single window.

This respects the user preference in which direction to split a window, determied e.g. by split-width-threshold and split-height-threshold (there may be other influences, but that's the one I know of/use).

Another UX improvement: When the split is created only so that an interactive other-window command can run, treat it as provisional and delete the redundant window again if the command quits or signals an error.

This avoids leaving an unused split behind when commands such as switch-window-then-dired or switch-window-then-find-file are cancelled during their own interactive prompt.

Tested with switch-window-threshold set to 1 and 2; please try it out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant