Intead of inserting one character at a time using Cursor.insertCharacter(), maintain an "insertion string" which represents the latest piece of text that the user has typed. This is maintained in a UITextField, which allows us to use the built-in autocorrect mechanism. Now, instead of calling insertCharacter(), we:
Intead of inserting one character at a time using Cursor.insertCharacter(), maintain
an "insertion string" which represents the latest piece of text that the user has typed.
This is maintained in a UITextField, which allows us to use the built-in autocorrect
mechanism. Now, instead of calling insertCharacter(), we:

- Call beginInsertion() when the user starts typing
- Call updateInsertion() when the insertion string changes
- Call endInsertion() when another operation is performed, to clear the insertion string

corinthia/corinthia-editorlib,corinthia/corinthia-editor,corinthia/corinthia-editor,corinthia/corinthia-editor,corinthia/corinthia-editorlib,corinthia/corinthia-editorlib,corinthia/corinthia-editorlib,corinthia/corinthia-editorlib,corinthia/corinthia-editor,corinthia/corinthia-editor