From bb9a5f19cf0ea6944fd8c67503e09aa5a2da4355 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 06:32:21 -0300 Subject: `:N:H` looked at on a PDF pane turns to page N, as `book.pdf:N:H` does from anywhere, not a refusal that a PDF has no text A PDF's own pane took only `:N`; `:5:3` was refused as no text to address while `book.pdf:5:3` turned to page 5 (its search hit 3). lookPdfPage now reads the page before a colon and the hit after it. Co-Authored-By: Claude Opus 5.5 --- test/pdf.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/pdf.zig b/test/pdf.zig index 727a1515..a1be4075 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -492,6 +492,12 @@ test "`:N` on a PDF turns to page N, from the pane and from the root's look, and try std.testing.expect(std.mem.indexOf(u8, record, "\nerr ") == null); _ = p.serveFs(.{ .tag = 4, .op = .release, .node = log, .handle = h }); while (p.nextEffect()) |_| {} + // `:N:H` on the pane is its page N, as `file.pdf:N:H` is. + p.look_missed = false; + pardes.look.lookAt(p, 0, ":1"); + pardes.look.lookAt(p, 0, ":2:3"); + try std.testing.expect(!p.look_missed); + try std.testing.expectEqual(@as(usize, 1), doc.pdf.?.page); // Page 0 is no page: the has-no-page miss. p.look_missed = false; pardes.look.lookAt(p, 0, ":0"); -- cgit v1.3