diff options
author | 2013-12-26 06:39:28 -0800 | |
---|---|---|
committer | 2013-12-26 06:39:28 -0800 | |
commit | 99dfe3f2731d25aee2399350163c873fceb08727 (patch) | |
tree | 76cb4cd99137d12bbf22a2a66549210c023e039a /java/src/com/android | |
parent | b9c96ca75a6ca4ad058b3da65f73858e15ef3939 (diff) | |
parent | 6bca9ac43d0db9a83b02577783cc609ecf13e3f4 (diff) | |
download | latinime-99dfe3f2731d25aee2399350163c873fceb08727.tar.gz latinime-99dfe3f2731d25aee2399350163c873fceb08727.tar.xz latinime-99dfe3f2731d25aee2399350163c873fceb08727.zip |
am 6bca9ac4: Fix a bug where predictions would not pop upon manual pick
* commit '6bca9ac43d0db9a83b02577783cc609ecf13e3f4':
Fix a bug where predictions would not pop upon manual pick
Diffstat (limited to 'java/src/com/android')
-rw-r--r-- | java/src/com/android/inputmethod/latin/WordComposer.java | 2 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index 7da97e57a..f078c7346 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -472,7 +472,7 @@ public final class WordComposer { mCapsCount = 0; mDigitsCount = 0; mIsBatchMode = false; - mPreviousWordForSuggestion = mTypedWord.toString(); + mPreviousWordForSuggestion = committedWord; mTypedWord.setLength(0); mCodePointSize = 0; mTrailingSingleQuotesCount = 0; diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 488ce6e7b..59b722134 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -1621,8 +1621,11 @@ public final class InputLogic { chosenWord, separatorString, prevWord); final boolean shouldDiscardPreviousWordForSuggestion; if (0 == StringUtils.codePointCount(separatorString)) { - // Separator is 0-length. Discard the word only if the current language has spaces. - shouldDiscardPreviousWordForSuggestion = settingsValues.mCurrentLanguageHasSpaces; + // Separator is 0-length, we can keep the previous word for suggestion. Either this + // was a manual pick or the language has no spaces in which case we want to keep the + // previous word, or it was the keyboard closing or the cursor moving in which case it + // will be reset anyway. + shouldDiscardPreviousWordForSuggestion = false; } else { // Otherwise, we discard if the separator contains any non-whitespace. shouldDiscardPreviousWordForSuggestion = |