aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-09-24 09:36:40 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-09-24 09:36:40 -0700
commitb5fc966da78e5a6bba35fa313f4e6ce88a21dd4b (patch)
tree5582a64ccb986c793c3da1e76833678f13a0a406
parentdba90e0e6ecd9245631e9e0dbefb5fe13cd70449 (diff)
parent355fb1392e52e2c354ce277f531a1787126f695d (diff)
downloadlatinime-b5fc966da78e5a6bba35fa313f4e6ce88a21dd4b.tar.gz
latinime-b5fc966da78e5a6bba35fa313f4e6ce88a21dd4b.tar.xz
latinime-b5fc966da78e5a6bba35fa313f4e6ce88a21dd4b.zip
am 355fb139: am 0eef4b1e: Merge "Add suggestion span upon starting a gesture." into jb-mr1-dev
* commit '355fb1392e52e2c354ce277f531a1787126f695d': Add suggestion span upon starting a gesture.
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 95f89c0cc..b8a8f9aaf 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -864,6 +864,15 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mSpaceState = SPACE_STATE_NONE;
if ((!mWordComposer.isComposingWord()) || selectionChanged || noComposingSpan) {
+ // If we are composing a word and moving the cursor, we would want to set a
+ // suggestion span for recorrection to work correctly. Unfortunately, that
+ // would involve the keyboard committing some new text, which would move the
+ // cursor back to where it was. Latin IME could then fix the position of the cursor
+ // again, but the asynchronous nature of the calls results in this wreaking havoc
+ // with selection on double tap and the like.
+ // Another option would be to send suggestions each time we set the composing
+ // text, but that is probably too expensive to do, so we decided to leave things
+ // as is.
resetEntireInputState(newSelStart);
}
@@ -1089,11 +1098,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (!mWordComposer.isComposingWord()) return;
final CharSequence typedWord = mWordComposer.getTypedWord();
if (typedWord.length() > 0) {
- mConnection.commitText(typedWord, 1);
- final CharSequence prevWord = addToUserHistoryDictionary(typedWord);
- mLastComposedWord = mWordComposer.commitWord(
- LastComposedWord.COMMIT_TYPE_USER_TYPED_WORD, typedWord.toString(),
- separatorString, prevWord);
+ commitChosenWord(typedWord, LastComposedWord.COMMIT_TYPE_USER_TYPED_WORD,
+ separatorString);
}
}