diff options
author | 2012-01-17 15:17:17 +0900 | |
---|---|---|
committer | 2012-01-17 16:16:52 +0900 | |
commit | edc6395d9bdbb46082c8582ee92f6ba184914d59 (patch) | |
tree | bdcea0756b8097e5069468cc7cd1ccbcef353207 /java/src | |
parent | a8ba49c2534220105ce302a50b3a9ddaf831ef20 (diff) | |
download | latinime-edc6395d9bdbb46082c8582ee92f6ba184914d59.tar.gz latinime-edc6395d9bdbb46082c8582ee92f6ba184914d59.tar.xz latinime-edc6395d9bdbb46082c8582ee92f6ba184914d59.zip |
Fix a bug where words disappear on inserting separators
The basic idea is that in some situations, we would restart
suggestions, but before evaluating them we would bail out
because suggestions were not requested. This would lead to
the "correction" set to null, so we would commit a null word.
This fix does two things:
- Do not restart suggestions when not requested.
- If we still end up with a composing word when suggestions
are not requested, we select the typed word as the
correct version.
Bug: 5846646
Change-Id: Ic35351841d0cb20afa99092ef681ecb7bd68bec6
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index e6c4ba71b..560b9fa9f 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1410,7 +1410,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (mDeleteCount > DELETE_ACCELERATE_AT) { ic.deleteSurroundingText(1, 0); } - restartSuggestionsOnWordBeforeCursorIfAtEndOfWord(ic); + if (isSuggestionsRequested()) { + restartSuggestionsOnWordBeforeCursorIfAtEndOfWord(ic); + } } } } @@ -1702,6 +1704,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // Check if we have a suggestion engine attached. if ((mSuggest == null || !isSuggestionsRequested()) && !mVoiceProxy.isVoiceInputHighlighted()) { + if (mWordComposer.isComposingWord()) { + Log.w(TAG, "Called updateSuggestions but suggestions were not requested!"); + mWordComposer.setAutoCorrection(mWordComposer.getTypedWord()); + } return; } |