diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 13:53:55 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | bb770b12a4ab9ef7dbeee9ade5a1e51e90b4d15b (patch) | |
| tree | 2d52699d01e15466ace122262a379b39ec8cbad1 /src/look.zig | |
| parent | 6dcacb15c53b2f032a573ed10e39777bc281a481 (diff) | |
| download | pardes-bb770b12a4ab9ef7dbeee9ade5a1e51e90b4d15b.tar.gz pardes-bb770b12a4ab9ef7dbeee9ade5a1e51e90b4d15b.zip | |
A PDF that cannot be read fails its look with its path and why
A truncated PDF said only look: <error>, with no path, where an image that cannot be read names both. It now says look: <path>: not a PDF pardes can read: <why>.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/look.zig')
| -rw-r--r-- | src/look.zig | 8 |
1 files changed, 6 insertions, 2 deletions
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; }; |
