aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-09-24 16:15:20 +0900
committerJean Chalard <jchalard@google.com>2012-09-24 20:25:46 +0900
commit6a58bb7ac95e804f87c4e88b5eb970d28210518e (patch)
treed13b3bcbbcc85229892d15fa784b0914740b5ec4 /java/src
parent65ef26081b78f52960ad520f997b3e79dcbb8528 (diff)
downloadlatinime-6a58bb7ac95e804f87c4e88b5eb970d28210518e.tar.gz
latinime-6a58bb7ac95e804f87c4e88b5eb970d28210518e.tar.xz
latinime-6a58bb7ac95e804f87c4e88b5eb970d28210518e.zip
Add suggestion span upon starting a gesture.
Bug: 7196761 Change-Id: If60cb809b205159ced1887f94b7caf9775fcf3bb
Diffstat (limited to 'java/src')
-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 b77eef412..5712d3b05 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -862,6 +862,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);
}
@@ -1087,11 +1096,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);
}
}