summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 16:44:45 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commitd09c1c36e4d4e1bc57aa14f5ba4c6131b6111429 (patch)
tree62d8d68a486950118af23dc5f623dccc1824d00a /src/exec.zig
parentb4172e6bde69eb35648f173f4497054d1fb2e0fc (diff)
downloadpardes-d09c1c36e4d4e1bc57aa14f5ba4c6131b6111429.tar.gz
pardes-d09c1c36e4d4e1bc57aa14f5ba4c6131b6111429.zip
Focus on a closed pane goes to the pane that takes its place, never to the one focused before
Dogfood closed a pane in one column and focus jumped to another column, only because that pane was focused last. Now removePane decides for every route (Del, a ctl del, a command pane's end, a 9P remove, a stillborn scratch replaced): the pane that grew into the rows, or the scratch standing in an emptied column; removeColumn gives it to the pane level with it in the column that takes the width. Closing an unfocused pane leaves focus alone. The per-caller focus lines in Del and replaceStillborn are gone, and so is prevFocus. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/exec.zig b/src/exec.zig
index bf3ed1f0..9a4e0a89 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -347,7 +347,7 @@ pub fn evictLonePristineTty(p: *Pardes, col: usize, keep_id: usize) void {
panes.Terminal.scrollbar(tt).total > tt.rows) return;
p.deinitPane(tt) catch |err| return p.reportError(tty_id, "close", err);
layout.compute(p); // a just-stacked doc has no rect yet; absorb snaps to rows
- layout.absorbVWeight(p, tty_id, null);
+ _ = layout.absorbVWeight(p, tty_id, null);
layout.removePane(p, tty_id);
p.panes[tty_id] = null;
if (p.active == tty_id) p.active = keep_id;
@@ -372,10 +372,8 @@ pub fn replaceStillborn(p: *Pardes) void {
if (out.from != .cmd or out.from.cmd != .New) return;
if (file.revision != 0 or file.content.len != 0) return;
if (old.tag.own) |own| if (!std.mem.eql(u8, own, tagline.defaultTail(old))) return;
- const was_active = p.active == old_id;
layout.compute(p); // the joiner may have no rect yet; absorb snaps to rows
p.removePane(old_id, new_id) catch |err| return p.reportError(old_id, "close", err);
- if (was_active) p.active = new_id;
}
// ---- REPLs ----