summaryrefslogtreecommitdiff
path: root/src/output_pane.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-02 17:17:35 -0300
committerGabriel Schneider <[email protected]>2026-08-10 09:17:07 -0300
commit5961587b227e5fa097fb033e32c29da08a23fb18 (patch)
tree359883d5531e595d47f75824a77a0c1323973e2e /src/output_pane.zig
parent487434a0b55fa7cf479f39481b51da0a7eda79e1 (diff)
downloadpardes-5961587b227e5fa097fb033e32c29da08a23fb18.tar.gz
pardes-5961587b227e5fa097fb033e32c29da08a23fb18.zip
tty/image: big harness + golden coverage pass
Diffstat (limited to 'src/output_pane.zig')
-rw-r--r--src/output_pane.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/output_pane.zig b/src/output_pane.zig
index 3308e22a..bd11a227 100644
--- a/src/output_pane.zig
+++ b/src/output_pane.zig
@@ -254,15 +254,18 @@ pub fn openJumps(p: *Pardes, id: usize) void {
for (p.jumps[0..p.njumps]) |j| {
const jp = p.panes[j.pane] orelse continue;
var idbuf: [16]u8 = undefined;
- const has_path = if (jp.file) |f| f.output == null else false;
+ const pdf_path: ?[]const u8 = if (comptime pardes.pdf_enabled) jp.pdfPath() else null;
+ const has_path = if (jp.file) |f| f.output == null else pdf_path != null;
const loc: []const u8 = if (has_path)
- jp.file.?.path
+ (if (jp.file) |f| f.path else pdf_path.?)
else
std.fmt.bufPrint(&idbuf, config.pane_addr ++ "{d}", .{j.pane}) catch continue;
const what: []const u8 = if (jp.file) |f|
std.mem.trim(u8, modal.lineSlice(f.content, j.line -| 1), " \t\r")
else if (jp.image) |iv|
iv.path
+ else if (pdf_path) |path|
+ path
else
jp.cwdSlice();
// one line of a file can be the whole file: cut it, but never mid