aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/TextEntryState.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-11-29 01:15:42 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-29 01:15:42 -0800
commit55042ff97732ccd755149f7a339a9be45957ae49 (patch)
treee3bb56abadbdd1f9796becc21d743778b417c9af /java/src/com/android/inputmethod/latin/TextEntryState.java
parentb230806f44441ea68f608f6430667fed85d3a048 (diff)
parent6b1f500da451de56932a8b2a99c63857994ece85 (diff)
downloadlatinime-55042ff97732ccd755149f7a339a9be45957ae49.tar.gz
latinime-55042ff97732ccd755149f7a339a9be45957ae49.tar.xz
latinime-55042ff97732ccd755149f7a339a9be45957ae49.zip
Merge "Resume suggestion when backspacing to the end of a word"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/TextEntryState.java')
-rw-r--r--java/src/com/android/inputmethod/latin/TextEntryState.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/TextEntryState.java b/java/src/com/android/inputmethod/latin/TextEntryState.java
index 82242f87e..a6041b310 100644
--- a/java/src/com/android/inputmethod/latin/TextEntryState.java
+++ b/java/src/com/android/inputmethod/latin/TextEntryState.java
@@ -146,9 +146,24 @@ public class TextEntryState {
} else if (sState == UNDO_COMMIT) {
setState(IN_WORD);
}
+ // TODO: tidy up this logic. At the moment, for example, writing a word goes to
+ // ACCEPTED_DEFAULT, backspace will go to UNDO_COMMIT, another backspace will go to IN_WORD,
+ // and subsequent backspaces will leave the status at IN_WORD, even if the user backspaces
+ // past the end of the word. We are not in a word any more but the state is still IN_WORD.
if (DEBUG) displayState("backspace");
}
+ public static void restartSuggestionsOnWordBeforeCursor() {
+ if (UNKNOWN == sState || ACCEPTED_DEFAULT == sState) {
+ // Here we can come from pretty much any state, except the ones that we can't
+ // come from after backspace, so supposedly anything except UNKNOWN and
+ // ACCEPTED_DEFAULT. Note : we could be in UNDO_COMMIT if
+ // LatinIME#revertLastWord() was calling LatinIME#restartSuggestions...()
+ Log.e(TAG, "Strange state change : coming from state " + sState);
+ }
+ setState(IN_WORD);
+ }
+
public static void reset() {
setState(START);
if (DEBUG) displayState("reset");