Files
ElyOffice/patches/mupdf/0001-snapshot-keeps-incremental-sections.patch
T
ZacharyZhang-NY b7fca0146d Ely Office: six offline-first desktop apps in Rust and GPUI
ElyDoc, ElyTable, ElyShow (LibreOfficeKit), ElyPDF (MuPDF), ElyTree (Git),
ElyMark (Milkdown and CodeMirror in CEF). ElyMail and ElyAgent follow.
2026-10-08 21:20:08 -04:00

20 lines
660 B
Diff

Snapshots keep the incremental sections: undo works after a save.
pdf_save_snapshot promises the document stays unchanged, yet the
write marked every incremental section saved; undoing an earlier
step then restored nothing (Ely's PDF save and extract).
--- a/source/pdf/pdf-write.c 2026-10-06 09:03:50
+++ b/source/pdf/pdf-write.c 2026-10-06 09:03:50
@@ -2869,7 +2869,9 @@
pdf_sync_open_pages(ctx, doc);
// mark incremental sections as having been saved
- doc->num_incremental_sections = 0;
+ // A snapshot keeps them, and the undo history.
+ if (!in_opts->do_snapshot)
+ doc->num_incremental_sections = 0;
pdf_end_operation(ctx, doc);
}