summaryrefslogtreecommitdiff
path: root/src/Output.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-25 11:08:56 -0300
committerGabriel Schneider <[email protected]>2026-10-25 11:08:56 -0300
commitc8ad18df1d46265c30721861760a744227e57b31 (patch)
tree05fd97d7fac1ab696a4ed53c6d23f28884758460 /src/Output.zig
parent53539a43789d402a9f774d8cf30c0a102331b5b3 (diff)
downloadpardes-c8ad18df1d46265c30721861760a744227e57b31.tar.gz
pardes-c8ad18df1d46265c30721861760a744227e57b31.zip
pdfrender 3: a PDF's place on the jumplist is its page and how far down it (a fraction, which a zoom or a resize keeps), its file's hash, so Back and Forward land on the exact offset through the motion system (a far one as one body's slide), places on one page more than a body apart are two entries, JumpScope file keeps to the PDF, and a closed PDF reopens at its place; the Jumplist pane prints a PDF's place as path:page
Diffstat (limited to 'src/Output.zig')
-rw-r--r--src/Output.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Output.zig b/src/Output.zig
index 01e3e0f1..a17b0459 100644
--- a/src/Output.zig
+++ b/src/Output.zig
@@ -701,6 +701,11 @@ pub fn openJumps(p: *Pardes, id: usize) !void {
// A closed file's entry: marked, and a look at it opens it again.
if (j.serial == 0) {
const e = p.recentByHash(j.path_hash) orelse continue;
+ // A PDF's `col` is how far down its page, no Look's column.
+ if (j.pdf) {
+ try out.writer.print("{s}:{d} (closed)\n", .{ e.path, @max(1, j.line) });
+ continue;
+ }
try out.writer.print("{s}:{d}:{d} (closed)\n", .{ e.path, @max(1, j.line), @max(1, j.col) });
continue;
}
@@ -724,6 +729,8 @@ pub fn openJumps(p: *Pardes, id: usize) !void {
while (cut > 0 and cut < what.len and what[cut] & 0xc0 == 0x80) cut -= 1;
if (j.line == 0)
try out.writer.print("{s} {s}\n", .{ loc, what[0..cut] })
+ else if (j.pdf)
+ try out.writer.print("{s}:{d} {s}\n", .{ loc, j.line, what[0..cut] })
else
try out.writer.print("{s}:{d}:{d} {s}\n", .{ loc, j.line, j.col, what[0..cut] });
}