summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 16:45:37 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit0f632dbd1069d9654d587ebac8e29955a9a31188 (patch)
tree6e858c3a3c71aa6ed651759024e137f703873743 /src/look.zig
parenta59e1ebfdd9f59102de98549eacddd7ca5d3ee84 (diff)
downloadpardes-0f632dbd1069d9654d587ebac8e29955a9a31188.tar.gz
pardes-0f632dbd1069d9654d587ebac8e29955a9a31188.zip
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: <file>: no match for regexp, on the pane of the file it searched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/look.zig')
-rw-r--r--src/look.zig7
1 files changed, 5 insertions, 2 deletions
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);