Merge "Update personalized dict only when single subtype is used."
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index b365003..c867ab3 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -1113,8 +1113,11 @@
keyboardSwitcher.getKeyboard());
mWordComposer.setCursorPositionWithinWord(
typedWord.codePointCount(0, numberOfCharsInWordBeforeCursor));
- mConnection.setComposingRegion(expectedCursorPosition - numberOfCharsInWordBeforeCursor,
- expectedCursorPosition + range.getNumberOfCharsInWordAfterCursor());
+ // TODO: Change these two lines to setComposingRegion(cursorPosition,
+ // cursorPosition + range.getNumberOfCharsInWordAfterCursor());
+ mConnection.deleteSurroundingText(numberOfCharsInWordBeforeCursor,
+ typedWord.length() - numberOfCharsInWordBeforeCursor);
+ mConnection.setComposingText(typedWord, 1);
if (suggestions.isEmpty()) {
// We come here if there weren't any suggestion spans on this word. We will try to
// compute suggestions for it instead.