Files
wordcraft/crates
Mat Strangeandopencode 23c8dfa974 A version snapshot belongs to the document it was taken from
`Session::set_document` resets everything about the open document — the
document id, the document, the selection, the undo history, the password,
the file name — but not the version snapshots. A snapshot taken of one
document therefore survived `file.new`, `file.open`, `file.newFromTemplate`
and `file.recover`, and `file.versions {"restore": index}` then put the
previous document's content into the open one.

The snapshots go with the document they were taken from: `set_document`
clears them, so a restore can only ever bring back a version of the
document that is open. Every caller replaces the document with another
one (a new or opened file, a recovered copy, a merge result, a sheet of
labels), so none of them loses anything it needs.

Co-Authored-By: opencode <noreply@opencode.ai>
2026-10-22 21:19:58 -06:00
..
2026-10-22 01:48:25 +00:00
2026-10-22 01:47:56 +00:00
2026-10-22 01:59:03 +00:00
2026-10-22 01:47:34 +00:00
2026-10-22 01:47:34 +00:00