diff options
author | 2011-12-13 06:30:56 -0800 | |
---|---|---|
committer | 2011-12-13 06:30:56 -0800 | |
commit | 01bf066c68b805a3b2352eb3a5a35350ad14283b (patch) | |
tree | 3f65cecc6870876f112a80d8f15f1fd7e7484211 /java/src/com | |
parent | 9d6113257c6def8b29c15455750350dfd477e5fd (diff) | |
parent | 8e3faff244a03aa49dfff03f2a6d982590ff605c (diff) | |
download | latinime-01bf066c68b805a3b2352eb3a5a35350ad14283b.tar.gz latinime-01bf066c68b805a3b2352eb3a5a35350ad14283b.tar.xz latinime-01bf066c68b805a3b2352eb3a5a35350ad14283b.zip |
am 8e3faff2: Merge "Decouple member logic from control flow"
* commit '8e3faff244a03aa49dfff03f2a6d982590ff605c':
Decouple member logic from control flow
Diffstat (limited to 'java/src/com')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index a470897db..8dfb04643 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1510,13 +1510,16 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (null != ic) removeTrailingSpaceWhileInBatchEdit(ic); } + boolean isComposingWord = mHasUncommittedTypedChars; int code = primaryCode; if ((isAlphabet(code) || mSettingsValues.isSymbolExcludedFromWordSeparators(code)) && isSuggestionsRequested() && !isCursorTouchingWord()) { - if (!mHasUncommittedTypedChars) { + if (!isComposingWord) { // Reset entirely the composing state anyway, then start composing a new word unless - // the character is a single quote. - mHasUncommittedTypedChars = (Keyboard.CODE_SINGLE_QUOTE != code); + // the character is a single quote. The idea here is, single quote is not a + // separator and it should be treated as a normal character, except in the first + // position where it should not start composing a word. + isComposingWord = (Keyboard.CODE_SINGLE_QUOTE != code); mWordComposer.reset(); clearSuggestions(); mComposingStateManager.onFinishComposingText(); @@ -1543,7 +1546,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } } } - if (mHasUncommittedTypedChars) { + if (isComposingWord) { + mHasUncommittedTypedChars = true; mWordComposer.add(code, keyCodes, x, y); if (ic != null) { // If it's the first letter, make note of auto-caps state |