From b88e6ddf653b6031b906493807b475395c4ae3c4 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 06:07:10 -0300 Subject: @p:
takes any sam address, as file:
does @p took a line spot but an address after it (/re/, #n, $, 0/re/, a range) was dropped, the name failing the file check, and an unknown serial fell through to a search. The pane is now addressed like a file; a miss and a serial no pane has each log an err, and look reads back empty. Co-Authored-By: Claude Opus 5.5 --- src/look.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/look.zig') diff --git a/src/look.zig b/src/look.zig index 8318973b..6a4fe1d1 100644 --- a/src/look.zig +++ b/src/look.zig @@ -1289,6 +1289,9 @@ fn lookAddress(p: *Pardes, id: usize, path: []const u8, expr: []const u8) void { .pane => |t| if (t.id < MAX_PANES and p.panes[t.id] != null) t.id else null, else => null, }; + // `@p:
`: that pane, or, not open, a miss said as one. + const by_serial = std.mem.startsWith(u8, path, config.pane_addr); + if (by_serial and open == null) return missed(p, id, "no pane {s}", .{path[0..@min(path.len, 32)]}); if (open) |o| target = o else if (path.len > 0) { const before = p.active; lookAt(p, id, path); @@ -1297,8 +1300,8 @@ fn lookAddress(p: *Pardes, id: usize, path: []const u8, expr: []const u8) void { if (target == before and target != id) return; } const pane = p.panes[target] orelse return; - const f = pane.file orelse return; - if (path.len > 0 and (f.output != null or !std.mem.endsWith(u8, f.path, std.fs.path.basename(path)))) return; + const f = pane.file orelse return missed(p, id, "{s} is no text to address", .{path[0..@min(path.len, 64)]}); + if (!by_serial and path.len > 0 and (f.output != null or !std.mem.endsWith(u8, f.path, std.fs.path.basename(path)))) return; var a: Addr = .{ .text = f.content, .lim = null, .expr = expr }; const r = a.address(ninep_pane.dotOf(pane)) orelse { return missed(p, id, "{s}", .{a.err}); -- cgit v1.3