Conversation
Dragging a pane near a tab's outer edge now offers a drop spanning the tab's full width or height. The pane becomes a child of the root splitter instead of splitting the hovered pane, which was the only placement available before. Same targets in Move Session to Split Pane. Zone size: tabEdgeDropZoneSize (0 disables). Not offered for tmux tabs.
# Conflicts: # sources/Settings/iTermAdvancedSettingsModel.m
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.
Problem
Every drop target for a moved pane splits the hovered pane's splitter.
SplitSelectionViewoffers four halves inside the pane under the pointer, and-[MovePaneController reallyDropInSession:half:atPoint:]turns that intosplitVertically:before:addingSession:targetSession:, which splits the target session's parent splitter.So with N panes side by side, there is no way to move a pane so it spans the whole top, bottom, left, or right of the tab: dropping on the north half of pane 3 gives a pane as wide as pane 3's column only. That placement requires a split at the tab's root splitter, which nothing exposes (outside tmux, where layouts can do it).
Change
Three panes side by side; dragging one near the top edge of the tab, then near the right edge:
Dragging a pane within
tabEdgeDropZoneSizepoints (default 24) of a tab's outer edge now offers a whole-tab drop target. The dropped pane becomes a child of the root splitter, spanning the tab's full width (top/bottom) or full height (left/right).The same targets work in Session > Move Session to Split Pane, since both the drag and click-to-move paths go through
-[SplitSelectionView updateAtPoint:].Details worth reviewing:
SplitSessionHalfgainskTabTopEdge/kTabBottomEdge/kTabLeftEdge/kTabRightEdgeplus three predicate functions. Every existing switch over the enum is exhaustive and was extended.-[PTYTab tabEdgesForSession:]compares frames in window coordinates, because split views are flipped and root's own space would invert top and bottom. Refused for tmux tabs (no tmux command moves a pane to a window edge), for a maximized pane, for a locked layout, and for a single-pane tab (where an edge drop equals a half drop).SplitSelectionViewin the window's content view instead. It is sized to the share the pane will actually get, so the preview does not lie. The hovered pane's own overlay draws nothing while a tab edge is selected.-[PTYTab insertSession:atTabEdge:]handles the three cases the waysplitVertically:newSession:before:targetSession:does for panes: root has one child (just set its orientation), root already splits along the needed axis (insert at the front or back), or root splits the other way (move its children into a new splitter that preserves their arrangement, flip the root, then insert).checkInvariants:runs before and after.-adjustSubviewswould hand it about half the tab regardless of how many panes were there.-giveNewRootSubview:anEqualShareAlongVertical:gives it an equal share and scales the existing panes proportionally, keeping their relative sizes.-[PseudoTerminal splitVertically:before:addingSession:targetSession:performSetup:]had ~70 lines of post-insert bookkeeping (tab color, divorce inheritance, focus, dimming, fitting) that the edge move needs verbatim. It moved into-addSession:targetSession:performSetup:insert:, which both callers use with a block; no behavior change on the existing path.tabEdgeDropZoneSize = 0disables the feature entirely, restoring the previous drop behavior.Testing
tools/build.shclean.ModernTests/iTermSplitSelectionViewTabEdgeTests.m: 8 tests, all passing. They drive-updateAtPoint:on a bare view: each eligible edge is selected near it, an edge that is not on the tab boundary is not offered, no mask means only halves, the zone is clamped on a short pane, selection is sticky within hysteresis, and the change callback reports entry and exit exactly once each.moveSession:… toTabEdge:6andtoTabEdge:9; the moved session went 43x38 → 137x18, i.e. full width at half height. No invariant failures in either the wrap case (top) or the same-axis case (right).Happy to adjust the default zone size, the visuals, or split this differently if you would rather have it another way.