From edc6395d9bdbb46082c8582ee92f6ba184914d59 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 17 Jan 2012 15:17:17 +0900 Subject: 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 --- java/src/com/android/inputmethod/latin/LatinIME.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'java/src') 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; } -- cgit v1.2.3-83-g751a