From 0493ed9c6e2af1c16b40a685efdb67881ac87570 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 01:40:00 -0300 Subject: A look at file:/re/ on an open pane goes on from its dot, and a miss leaves it Look's clean start cleared the active pane's selection before the address read the dot, so the root look's file:/re/ always found the same match, a miss collapsed the dot to a caret, and dumps kept the collapsed dot. A pane already open on the path is now addressed where it stands. Co-Authored-By: Claude Opus 5.5 --- src/look.zig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/look.zig') diff --git a/src/look.zig b/src/look.zig index 542b1b63..9dfd912f 100644 --- a/src/look.zig +++ b/src/look.zig @@ -1237,7 +1237,15 @@ fn lookAddress(p: *Pardes, id: usize, path: []const u8, expr: []const u8) void { const ninep_pane = @import("ninep/pane.zig"); const Addr = @import("ninep/addr.zig").Addr; var target = id; - if (path.len > 0) { + // A pane already open on the path is evaluated where it stands: Look's + // own clean start would collapse its dot (and the looker's) before the + // address ever read it, so `f:/re/` again would find the same match. + var realbuf: [4096]u8 = undefined; + const open: ?usize = if (path.len == 0) null else switch (resolveLookTarget(p, id, path, &realbuf)) { + .pane => |t| if (t.id < MAX_PANES and p.panes[t.id] != null) t.id else null, + else => null, + }; + if (open) |o| target = o else if (path.len > 0) { const before = p.active; lookAt(p, id, path); target = p.active; -- cgit v1.3