correctSpelling

fun correctSpelling(segment: WordSegment, correction: String)(source)

Replace a misspelled word with the chosen correction.

Applies the replacement to textState and removes the word's spell-check decoration once the correction has landed as given. If TextEditorState.inputFilter refuses it, the word stays flagged; a correction the filter changes is an edit like any other, which the edit's re-check settles.

Parameters

segment

The misspelled WordSegment to correct.

correction

The replacement text.