diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 11:26:35 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 13:14:28 -0300 |
| commit | d815a5cc854b3cd14a89f401565db212c3dc9d88 (patch) | |
| tree | 1335995520095445488d26dc030dd777db010fd9 /src/addon_test.zig | |
| parent | 8640107e29a940d50a5eef0dc7d12689a515d856 (diff) | |
| download | pardes-d815a5cc854b3cd14a89f401565db212c3dc9d88.tar.gz pardes-d815a5cc854b3cd14a89f401565db212c3dc9d88.zip | |
text journal, the ring and undo over it: a file's undo is the journal of its edits (Text.Journal: entries of an offset, the bytes taken out and the count put in, grouped in steps between marks, each step with the place it began at and the place it was undone from), bounded at 256 steps or 64 MiB, the newest kept; pushUndo marks a step (none when the last changed nothing, as a snapshot equal to the text was none) and every edit goes into the last step, joined to its last entry when they touch (typing on, backspace over it, a write going on where the last ended); undo and redo turn a step's entries round, one in place, several in a copy whose gap moves from one to the next (File.Gap), one edit and one revision as the snapshot's was; the snapshots go (File.Snapshot, the undo and redo arrays and their copies of the whole text at every step); the replica's copy pins an entry's bytes (Entry.removed, a blob) as it pinned a snapshot's; tests: 'undo keeps its steps within a byte bound, the newest always' reads the journal, 'file history owns bounded snapshot storage without per-edit bookkeeping allocations' becomes 'file history keeps its last undo_max steps, and an undo or redo with no memory changes nothing', the far join's blob test makes its two blobs beside the text with a delete and a yank (its history held whole texts before), and the counts of steps read history.journal.done
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/addon_test.zig')
0 files changed, 0 insertions, 0 deletions
