aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com
diff options
context:
space:
mode:
authorTom Ouyang <ouyang@google.com>2015-03-06 02:29:34 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-06 02:29:35 +0000
commit8eb2fad5702d4d58476a015a5469a4d84adf4bbc (patch)
treec2fb4896731e5acffc3cd5ecac88bf9bbfbbc5ae /java/src/com
parentc4f6a8dcd4076ff04977199b4e3a4c79f7d06efe (diff)
parent222f647137917ef602c1e1510c499a42d2e1eb47 (diff)
downloadlatinime-8eb2fad5702d4d58476a015a5469a4d84adf4bbc.tar.gz
latinime-8eb2fad5702d4d58476a015a5469a4d84adf4bbc.tar.xz
latinime-8eb2fad5702d4d58476a015a5469a4d84adf4bbc.zip
Merge "Restart suggestions when backspacing into a reverted word."
Diffstat (limited to 'java/src/com')
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 92bd60658..934da7ac7 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -1027,6 +1027,20 @@ public final class InputLogic {
revertCommit(inputTransaction, inputTransaction.mSettingsValues);
StatsUtils.onRevertAutoCorrect();
StatsUtils.onWordCommitUserTyped(lastComposedWord, mWordComposer.isBatchMode());
+ // Restart suggestions when backspacing into a reverted word. This is required for
+ // the final corrected word to be learned, as learning only occurs when suggestions
+ // are active.
+ //
+ // Note: restartSuggestionsOnWordTouchedByCursor is already called for normal
+ // (non-revert) backspace handling.
+ if (inputTransaction.mSettingsValues.isSuggestionsEnabledPerUserSettings()
+ && inputTransaction.mSettingsValues.mSpacingAndPunctuations
+ .mCurrentLanguageHasSpaces
+ && !mConnection.isCursorFollowedByWordCharacter(
+ inputTransaction.mSettingsValues.mSpacingAndPunctuations)) {
+ restartSuggestionsOnWordTouchedByCursor(inputTransaction.mSettingsValues,
+ false /* forStartInput */, currentKeyboardScriptId);
+ }
return;
}
if (mEnteredText != null && mConnection.sameAsTextBeforeCursor(mEnteredText)) {