Repository navigation
fix: after Super+V or Super+Z, the next window opens that way with auto-split on - #578
Open
mattchristenson wants to merge 1 commit into
Open
mattchristenson wants to merge 1 commit into
mattchristenson wants to merge 1 commit into
Conversation
…to-split on Super+V/Super+Z set the direction for the focused window's container (or the workspace, for a lone window). With auto-split on (the default), opening the next window split the focused window again by its shape, which overrode that choice: a landscape window got its new neighbour beside it after Super+V (forge-ext#409). The Split command, when the user gives it (auto-split's own call is marked), records the choice for the focused window on the node whose direction it set. While that window is still the only tiled window there, trackWindow() doesn't auto-split it for a new window. Auto-split now also only runs for a window Forge will manage and doesn't have yet, so menus and tooltips don't set it off. Fixes forge-ext#409 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #409.
Problem. Super+V (split vertically) and Super+Z (split horizontally) choose the direction for the next window: the focused window goes into a container with that direction, or, if it is alone on the workspace, the workspace takes that direction. With auto-split on (the default), opening the next window ran the auto-split on the focused window first. That splits it again by its shape (side by side if it is wider than tall), so the direction the user had just chosen was overridden:
Change.
Splitcommand, when the user gives it, records the choice for the focused window on the node whose direction it set (splitChosenFor). Auto-split's ownSplitcall is markedauto: trueand records nothing.trackWindow()doesn't auto-split it when a new window opens, so the new window goes the chosen way. Once a window has joined, the choice has done its job. When a tiled window leaves that node, the record is cleared, so a one-time choice doesn't keep overriding auto-split later.Without a Split command, auto-split works as before.
Merging note. #576 makes the same "only for a new window" change for another reason. Whichever merges second keeps one copy.
Testing. Scenario
scenarios/25_split_then_open.py(auto-split on):main, where it opens beside;main, where it opens below;25.5 and 25.6 fail on
main:main2/6 → 6/6 (25.1 passes onmainonly because B's shape happens to agree). The rest of the suite is unchanged.prettier@2.7.1 --checkis clean.🤖 Generated with Claude Code