Repository navigation
Add a repeated-commands option that switches to the opposite side - #1925
Open
AkiyamaKunka wants to merge 1 commit into
Open
AkiyamaKunka wants to merge 1 commit into
AkiyamaKunka wants to merge 1 commit into
Conversation
Repeating Left Half while the window still sits on the left half now moves it to the right half, and the next repeat brings it back; the same for Right, Top and Bottom. The new "Switch to the opposite side on half actions" entry in the Repeated commands setting (subsequentExecutionMode 6) is off by default, so existing behaviour is unchanged. The toggle works through the action history: the calculation reports the opposite half as its resulting action, so the next press of the same shortcut is no longer a repeat and falls back to the plain half. A first execution, a window that moved since the last action, or an unrelated last action get a plain half. Thirds, fourths and the grid actions keep their existing repeat behaviour in this mode, and the option neither resizes nor traverses displays. Leaves WindowManager.swift and the execute path untouched: the logic lives in the half calculations, with a shared isRepeatedCommand overload for RectCalculationParameters. The only change on the WindowManager side is a guard in cooperativeCornerResizePlan so that, in this mode, a repeated half action that moved both of its edges (a side switch) is treated as a move rather than as a resize of the shared edge, which would otherwise squeeze the neighbour and record a wrong split ratio. Documents the value in TerminalCommands.md (and the undocumented value 5) and adds the zh-Hans string. Tests cover both axes, the complementary split ratio at 60%, the interplay with "halves preserve the other axis", the cooperative-resize guard, and that no other mode switches sides. Closes rxhanson#1761 Co-Authored-By: Claude Fable 5.1 <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.
Closes #1761.
Adds "Switch to the opposite side on half actions" to the Repeated commands setting (
subsequentExecutionMode6, off by default). Repeating Left Half while the window still sits on the left half moves it to the right half and the next repeat brings it back; the same for Right, Top and Bottom. The calculation reports the opposite half as the resulting action, so the next press is no longer a repeat and falls back to a plain half. A first execution, a window that moved since, or an unrelated last action get a plain half; thirds, fourths and the grid actions keep their existing repeat behaviour, and the option neither resizes nor traverses displays.Given the WindowManager refactor mentioned on #1913, the logic lives in the half calculations (plus a shared
isRepeatedCommandoverload forRectCalculationParameters). The only change on the WindowManager side is a guard incooperativeCornerResizePlan: in this mode a repeated half action that moved both of its edges is a move, not a resize of the shared edge, which would otherwise squeeze the neighbour and record a wrong split ratio.One semantic note: the behaviour is state-based, so pressing Right Half on a window that reached the right half through a flipped Left Half counts as a repeat and flips it back.
Also documents values 5 and 6 in TerminalCommands.md and adds the zh-Hans string. Tests cover both axes, the complementary split ratio at 60%, the interplay with "halves preserve the other axis", the cooperative-resize guard, and that no other mode switches sides. 600 tests pass on macOS 27.0.1 / Xcode 27.
🤖 Generated with Claude Code