Merge "Decouple member logic from control flow"
This commit is contained in:
commit
8e3faff244
1 changed files with 8 additions and 4 deletions
|
@ -1510,13 +1510,16 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
if (null != ic) removeTrailingSpaceWhileInBatchEdit(ic);
|
if (null != ic) removeTrailingSpaceWhileInBatchEdit(ic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isComposingWord = mHasUncommittedTypedChars;
|
||||||
int code = primaryCode;
|
int code = primaryCode;
|
||||||
if ((isAlphabet(code) || mSettingsValues.isSymbolExcludedFromWordSeparators(code))
|
if ((isAlphabet(code) || mSettingsValues.isSymbolExcludedFromWordSeparators(code))
|
||||||
&& isSuggestionsRequested() && !isCursorTouchingWord()) {
|
&& isSuggestionsRequested() && !isCursorTouchingWord()) {
|
||||||
if (!mHasUncommittedTypedChars) {
|
if (!isComposingWord) {
|
||||||
// Reset entirely the composing state anyway, then start composing a new word unless
|
// Reset entirely the composing state anyway, then start composing a new word unless
|
||||||
// the character is a single quote.
|
// the character is a single quote. The idea here is, single quote is not a
|
||||||
mHasUncommittedTypedChars = (Keyboard.CODE_SINGLE_QUOTE != code);
|
// 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();
|
mWordComposer.reset();
|
||||||
clearSuggestions();
|
clearSuggestions();
|
||||||
mComposingStateManager.onFinishComposingText();
|
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);
|
mWordComposer.add(code, keyCodes, x, y);
|
||||||
if (ic != null) {
|
if (ic != null) {
|
||||||
// If it's the first letter, make note of auto-caps state
|
// If it's the first letter, make note of auto-caps state
|
||||||
|
|
Loading…
Reference in a new issue