aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorJon Kinney <jonkinney@gmail.com>2026-08-04 16:35:15 -0500
committerGitHub <noreply@github.com>2026-08-05 00:35:15 +0300
commit09cdd88d0aca35617eb05468c2421b0467656e4f (patch)
tree46ab6bec955c322d7c49148bee2762c502dd8662 /src/server
parent93e0086f383f000ada02be382230507d5bdf4d7e (diff)
fix(layout): return focus to the pane a split was opened from (#2266)
Closing a focused pane handed focus to the next pane in tree order. For a pane opened beside another one -- a plugin split, a file viewer, any transient tool pane -- that is rarely where the user was: it lands on some unrelated neighbour rather than the pane that opened it. Track the pane focus came from in TileLayout and prefer it when the focused pane closes, falling back to tree order when there is no history, when it points at the pane being closed, or when it points at a pane that has since gone away. The history lives in the layout, so it can only ever name a pane in the same tab. A one-slot history is only sound if internal focus excursions never write it, so the tree edits that used to bounce focus around now go through target-taking primitives instead. close_pane removes a background pane directly, so detach_pane and take_pane_for_move stop focus-close-refocusing. split_pane splits a target without moving focus: the runtime split path only focuses the new pane once the spawn succeeds, which makes a failed split a pure rollback, and the targeted and unfocused workspace split paths stop fabricating history. insert_pane_near now takes the focus intent, so an unfocused pane move leaves the target tab's history alone. The layout-level focused-split helpers become test-only; production splits all flow through the target-taking path. Co-authored-by: Can Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'src/server')
0 files changed, 0 insertions, 0 deletions