From bb770b12a4ab9ef7dbeee9ade5a1e51e90b4d15b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 13:53:55 -0300 Subject: A PDF that cannot be read fails its look with its path and why A truncated PDF said only look: , with no path, where an image that cannot be read names both. It now says look: : not a PDF pardes can read: . Co-Authored-By: Claude Opus 5.5 --- src/look.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/look.zig') diff --git a/src/look.zig b/src/look.zig index 4e948fad..09e371b2 100644 --- a/src/look.zig +++ b/src/look.zig @@ -1540,8 +1540,12 @@ pub fn lookAt(p: *Pardes, id: usize, operand: []const u8) void { if (comptime pdf_enabled) if (target.kind == .pdf) { if (focusPaneByPath(p, target.path, target.at)) return; const free = p.freeSlot() orelse return p.reportError(id, "look", error.NoPaneSlots); - _ = panes.Pdf.openPane(p, free, target.path, target.at.line) catch |err| - return p.reportError(id, "look", err); + // Said with its path and why, as an image that cannot be read is. + _ = panes.Pdf.openPane(p, free, target.path, target.at.line) catch |err| { + var said: [miss_path_cap + 64]u8 = undefined; + var cut: [miss_path_cap + "…".len]u8 = undefined; + return p.reportError(id, std.fmt.bufPrint(&said, "look: {s}: not a PDF pardes can read", .{missText(target.path, &cut)}) catch "look: not a PDF pardes can read", err); + }; exec.placeNew(p, id, id, free, .doc); return; }; -- cgit v1.3