diff options
author | 2011-06-30 18:34:10 +0900 | |
---|---|---|
committer | 2011-06-30 18:35:17 +0900 | |
commit | 9ae24750f462cbd94b362fe54a952c86cfb05e5f (patch) | |
tree | 5630a9e636f09624f3cd4e363b1a42a03e732045 /java/src | |
parent | ffefdb6c1a4a7dfc0cebc071979b0a816fe89304 (diff) | |
download | latinime-9ae24750f462cbd94b362fe54a952c86cfb05e5f.tar.gz latinime-9ae24750f462cbd94b362fe54a952c86cfb05e5f.tar.xz latinime-9ae24750f462cbd94b362fe54a952c86cfb05e5f.zip |
Some clean up and fixes around auto-correction cancellation logic
Change-Id: I07f4c3cd98d14d9f0da2de54bfa76a3867389f6f
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 10 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/TextEntryState.java | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 874d77f19..a83aca0a2 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1181,7 +1181,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mVoiceProxy.handleBackspace(); - boolean deleteChar = false; + final boolean deleteChar = !mHasUncommittedTypedChars; if (mHasUncommittedTypedChars) { final int length = mComposing.length(); if (length > 0) { @@ -1202,8 +1202,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } else { ic.deleteSurroundingText(1, 0); } - } else { - deleteChar = true; } mHandler.postUpdateShiftKeyState(); @@ -1231,7 +1229,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // different behavior only in the case of picking the first // suggestion (typed word). It's intentional to have made this // inconsistent with backspacing after selecting other suggestions. - revertLastWord(deleteChar); + revertLastWord(true /* deleteChar */); } else { sendDownUpKeyEvents(KeyEvent.KEYCODE_DEL); if (mDeleteCount > DELETE_ACCELERATE_AT) { @@ -1799,7 +1797,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar return TextUtils.equals(text, beforeText); } - public void revertLastWord(boolean deleteChar) { + private void revertLastWord(boolean deleteChar) { final int length = mComposing.length(); if (!mHasUncommittedTypedChars && length > 0) { final InputConnection ic = getCurrentInputConnection(); @@ -1837,7 +1835,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } } - public boolean revertDoubleSpace() { + private boolean revertDoubleSpace() { mHandler.cancelDoubleSpacesTimer(); final InputConnection ic = getCurrentInputConnection(); // Here we test whether we indeed have a period and a space before us. This should not diff --git a/java/src/com/android/inputmethod/latin/TextEntryState.java b/java/src/com/android/inputmethod/latin/TextEntryState.java index de13f3ae4..b6e261114 100644 --- a/java/src/com/android/inputmethod/latin/TextEntryState.java +++ b/java/src/com/android/inputmethod/latin/TextEntryState.java @@ -144,7 +144,7 @@ public class TextEntryState { break; case UNDO_COMMIT: if (isSpace || isSeparator) { - setState(ACCEPTED_DEFAULT); + setState(START); } else { setState(IN_WORD); } |