replaceText

open override fun replaceText(range: IntRange, text: String, newSelection: K3TextRange, newComposition: K3TextRange?)(source)

Request to perform a replace text operation on the underlying editor.

Parameters

range

The range in the editor to be replaced, in Kotlin characters. Should typically be within the editor bounds, but state mismatches may cause this range to be out-of-bounds.

text

The text data that replaces the current text identified by range.

newSelection

The new selection after the replacement action has been performed. This selection may be anywhere, including in the middle of the replacement range.

newComposition

The new composing region, if any. May be anywhere in the editor bounds, including in the middle of the replacement range.