diff options
Diffstat (limited to 'src/look.zig')
| -rw-r--r-- | src/look.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/look.zig b/src/look.zig index 2e8a4b39..36b91545 100644 --- a/src/look.zig +++ b/src/look.zig @@ -1481,6 +1481,11 @@ pub fn reopenAt(p: *Pardes, from: usize, path: []const u8, at: Spot) void { lookAt(p, from, path); const id = p.active; const pane = p.panes[id] orelse return; + // A PDF's place is its page, the last if it has fewer now. + if (comptime pdf_enabled) if (pane.pdf) |*pv| if (std.mem.eql(u8, pv.path, path)) { + if (at.line > 0 and pv.focusLocation(p.pdf_gpa, @min(at.line, pv.page_count), 0)) panes.Pdf.resetPageChrome(pane); + return; + }; const f = if (pane.file) |*file| file else return; if (!std.mem.eql(u8, f.path, path)) return; // The empty "line" after a final newline is no line to land on. |
