aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2010-11-16 18:57:03 +0900
committerKen Wakasa <kwakasa@google.com>2010-11-16 19:18:05 +0900
commitc1e2e827b5d1bba59eb99d322dc101657ec28768 (patch)
treeae954b75dbd08b6120ce0c367c47c344ae9273b4 /java/src
parent889691eca1ad991a85fb721deb37ecba6a913762 (diff)
downloadlatinime-c1e2e827b5d1bba59eb99d322dc101657ec28768.tar.gz
latinime-c1e2e827b5d1bba59eb99d322dc101657ec28768.tar.xz
latinime-c1e2e827b5d1bba59eb99d322dc101657ec28768.zip
Canceled auto-completion shouldn't be re-auto-completed
bug: 2847211 Change-Id: I2185fcf6b798a41135c329485914bc035fad5119
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java20
1 files changed, 8 insertions, 12 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 156d0bcca..9e8f235fd 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -231,7 +231,7 @@ public class LatinIME extends InputMethodService
// Indicates whether the suggestion strip is to be on in landscape
private boolean mJustAccepted;
- private CharSequence mJustRevertedSeparator;
+ private boolean mJustReverted;
private int mDeleteCount;
private long mLastKeyTime;
@@ -860,8 +860,7 @@ public class LatinIME extends InputMethodService
// Don't look for corrections if the keyboard is not visible
if (mKeyboardSwitcher.isInputViewShown()) {
// Check if we should go in or out of correction mode.
- if (isPredictionOn()
- && mJustRevertedSeparator == null
+ if (isPredictionOn() && !mJustReverted
&& (candidatesStart == candidatesEnd || newSelStart != oldSelStart
|| TextEntryState.isCorrecting())
&& (newSelStart < newSelEnd - 1 || (!mPredicting))
@@ -1287,7 +1286,7 @@ public class LatinIME extends InputMethodService
handleCharacter(primaryCode, keyCodes);
}
// Cancel the just reverted state
- mJustRevertedSeparator = null;
+ mJustReverted = false;
}
if (mKeyboardSwitcher.onKey(primaryCode)) {
changeKeyboardMode();
@@ -1311,7 +1310,7 @@ public class LatinIME extends InputMethodService
ic.commitText(text, 1);
ic.endBatchEdit();
updateShiftKeyState(getCurrentInputEditorInfo());
- mJustRevertedSeparator = null;
+ mJustReverted = false;
mJustAddedAutoSpace = false;
mEnteredText = text;
}
@@ -1386,7 +1385,7 @@ public class LatinIME extends InputMethodService
}
}
}
- mJustRevertedSeparator = null;
+ mJustReverted = false;
ic.endBatchEdit();
}
@@ -1532,10 +1531,7 @@ public class LatinIME extends InputMethodService
// not to auto correct, but accept the typed word. For instance,
// in Italian dov' should not be expanded to dove' because the elision
// requires the last vowel to be removed.
- if (mAutoCorrectOn && primaryCode != '\'' &&
- (mJustRevertedSeparator == null
- || mJustRevertedSeparator.length() == 0
- || mJustRevertedSeparator.charAt(0) != primaryCode)) {
+ if (mAutoCorrectOn && primaryCode != '\'' && !mJustReverted) {
pickedDefault = pickDefaultSuggestion();
// Picked the suggestion by the space key. We consider this
// as "added an auto space".
@@ -2235,7 +2231,7 @@ public class LatinIME extends InputMethodService
if (!mPredicting && length > 0) {
final InputConnection ic = getCurrentInputConnection();
mPredicting = true;
- mJustRevertedSeparator = ic.getTextBeforeCursor(1, 0);
+ mJustReverted = true;
if (deleteChar) ic.deleteSurroundingText(1, 0);
int toDelete = mCommittedLength;
CharSequence toTheLeft = ic.getTextBeforeCursor(mCommittedLength, 0);
@@ -2249,7 +2245,7 @@ public class LatinIME extends InputMethodService
mHandler.postUpdateSuggestions();
} else {
sendDownUpKeyEvents(KeyEvent.KEYCODE_DEL);
- mJustRevertedSeparator = null;
+ mJustReverted = false;
}
}