summaryrefslogtreecommitdiff
path: root/src/edit_cmd.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 12:14:09 -0300
committerGabriel Schneider <[email protected]>2026-11-05 13:14:28 -0300
commitc9b9dad8469f5d654c31d688d7e2d93da8325f39 (patch)
tree320970e90a6da6dbb41acd90b5dcc679127429ab /src/edit_cmd.zig
parent7ff2368427c2c11488ead052f2fc7f1dd3ff6143 (diff)
downloadpardes-c9b9dad8469f5d654c31d688d7e2d93da8325f39.tar.gz
pardes-c9b9dad8469f5d654c31d688d7e2d93da8325f39.zip
text journal, a text replaced whole is swapped, not copied (the architect's 15.3): an edit that takes out most of a text and at least 64 KiB of it (Get, Edit's e, a Restore, a 9P > body write, a delete of everything) gives the old buffer to the journal by pointer (Text.Journal.swap, an Entry with swap set and its buffer's room, a derived field) where it copied what it took out, and puts the rest in a new buffer; its undo swaps the buffers back, a step that began with a swap (a > and the writes after it) folding into one swap the other way (Journal.fold), so neither the edit, its undo nor its redo copies the old text; the 64 MiB bound counts copied bytes only, and a text keeps two swaps: a third drops the steps before the older, said in the pane's message row ('undo keeps the last two texts replaced whole: the steps before them are gone'); tests: 'a text replaced whole keeps its old buffer for its undo, swapped back and forth, two at most' is new, and 'undo keeps its steps within a byte bound, the newest always' takes out middles under half the text, so what it bounds are copies
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/edit_cmd.zig')
0 files changed, 0 insertions, 0 deletions