edit

fun edit(block: DocumentEditScope.() -> Unit)

Applies a batch of edits to the document as one compound change. Insertions, replacements and deletions made on the DocumentEditScope are committed together, then the caret is placed as the block requested (its default rests after the last insertion).

Parameters

block

the edits, made on a DocumentEditScope over this state's document. Do not retain the scope beyond the call: an edit made on it afterwards lands on the document as a change of its own, outside this compound one and outside the caret placement.

See also