From c8ad18df1d46265c30721861760a744227e57b31 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 25 Oct 2026 11:08:56 -0300 Subject: 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 --- src/Output.zig | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Output.zig') 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] }); } -- cgit v1.3