Improvements on #218: setPosition after deleting a word, update caret.