From 0f632dbd1069d9654d587ebac8e29955a9a31188 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 16:45:37 -0300 Subject: A look that misses file:/re/ names the file and is logged as that file's pane's A miss said only look: no match for regexp, against the pane the look came from. It now says look: : no match for regexp, on the pane of the file it searched. 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 79cbd50d..a29b27b5 100644 --- a/src/look.zig +++ b/src/look.zig @@ -1334,11 +1334,14 @@ fn lookAddress(p: *Pardes, id: usize, path: []const u8, expr: []const u8) void { }; 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 }; + // A miss names the file it was looked for in, and is that file's pane's. + var cut: [miss_path_cap + "…".len]u8 = undefined; + const name = missText(f.path, &cut); const r = a.address(ninep_pane.dotOf(pane)) orelse { - return missed(p, id, "{s}", .{a.err}); + return missed(p, target, "{s}: {s}", .{ name, a.err }); }; if (a.i < expr.len or r.q0 > r.q1) { - return missed(p, id, "{s}", .{if (r.q0 > r.q1) "addresses out of order" else "bad address syntax"}); + return missed(p, target, "{s}: {s}", .{ name, if (r.q0 > r.q1) "addresses out of order" else "bad address syntax" }); } clearNavigationSelection(p, pane); ninep_pane.setDot(pane, r); -- cgit v1.3