updateState
Allows to update the state of this input method and to perform side effects on the current editor.
This function is thread-safe and may be called from any number of threads concurrently. If there is already a state update in progress, additional calls will suspend until that update is completed.
Usage example:
inputMethod.updateState {
// Direct effects on state
emitText(…)
emitDescriptor(…)
emitBackspace()
…
// At any point the current state may be accessed and re-assigned via state.
state = state.copy(…)
}Content copied to clipboard
After the update state scope returns, activeState will be updated with the value last assigned, if any.