Skip to content

snapBatchEditRanges

const snapBatchEditRanges: (snapshot, edits) => readonly PieceTableEdit[]

The edits a batch will actually apply: validated, ordered, and snapped off any surrogate pair they would otherwise split. Callers that report a change to anyone else — the session’s change events, undo inversion, incremental re-render — must describe these, not the edits they were handed, or every consumer is told about a transformation that did not happen.

Snapping is idempotent, so a caller may run this and still hand the result to applyBatchToPieceTable.

PieceTableTreeSnapshot

readonly PieceTableEdit[]

readonly PieceTableEdit[]