From 38401272446dbaec785e656b921cfbd31162ba09 Mon Sep 17 00:00:00 2001 From: Victoria Lease Date: Tue, 7 Jan 2014 23:26:54 +0000 Subject: [PATCH] Revert "Fix a race condition." This reverts commit 42e83c7f06a1683b27a11564aeb9f3999b10382f. Bug: 12434783 Change-Id: Id01b6d14906430b13e64f5fc4d7fb01572d0a960 --- .../android/inputmethod/latin/inputlogic/InputLogic.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index c867ab3d3..b365003a5 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -1113,11 +1113,8 @@ public final class InputLogic { keyboardSwitcher.getKeyboard()); mWordComposer.setCursorPositionWithinWord( typedWord.codePointCount(0, numberOfCharsInWordBeforeCursor)); - // TODO: Change these two lines to setComposingRegion(cursorPosition, - // cursorPosition + range.getNumberOfCharsInWordAfterCursor()); - mConnection.deleteSurroundingText(numberOfCharsInWordBeforeCursor, - typedWord.length() - numberOfCharsInWordBeforeCursor); - mConnection.setComposingText(typedWord, 1); + mConnection.setComposingRegion(expectedCursorPosition - numberOfCharsInWordBeforeCursor, + expectedCursorPosition + range.getNumberOfCharsInWordAfterCursor()); 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.