Back to API Reference
Struct
EditShape
sealed
The shape of one document mutation: Removed codepoints replaced by Inserted codepoints at Start. Produced by every gap-buffer mutation; consumers use it to patch derived indexed state (range maps, cached counts, undo history) instead of recomputing from the whole document.
Maps a codepoint index valid before this edit to the equivalent index after it: indices before Start are unchanged, indices at or after the removed range shift by Delta (an index exactly at a pure insertion point moves after the inserted text), and indices strictly inside the removed range collapse to Start.
