diff options
Diffstat (limited to 'src/file_watch.zig')
| -rw-r--r-- | src/file_watch.zig | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/file_watch.zig b/src/file_watch.zig index 4aba6c39..ab902e5b 100644 --- a/src/file_watch.zig +++ b/src/file_watch.zig @@ -496,7 +496,17 @@ pub fn reloadPane( const path = pane.pdfPath() orelse return false; const before = identify(io, path) catch return false; switch (watched.generation) { - .pdf => |accepted| if (accepted) |identity| if (identity.eql(before)) return false, + .pdf => |accepted| if (accepted) |identity| { + if (identity.eql(before)) return false; + } else if (pardes.panes.Pdf.sameBytes(core, pane)) { + // Armed over the bytes the pane opened (a text's baseline is its + // content, a PDF's is what it read): nothing to reload. Parsing + // the document again doubled every PDF's open. + if (watches[id]) |*live| if (live.serial == watched.serial) { + live.generation = .{ .pdf = before }; + }; + return false; + }, .text => {}, } if (!core.reloadWatchedFile(@intCast(id), &.{})) return false; |
