Don't ask for surrounding characters for each keypress
Bug: 6464226 Change-Id: I03745bbcc21e5ec6ca57fa1257bf21c0cd26391a
This commit is contained in:
parent
67b2c58404
commit
736b109e16
1 changed files with 12 additions and 14 deletions
|
@ -1480,20 +1480,18 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
|
|
||||||
if ((isAlphabet(primaryCode)
|
if ((isAlphabet(primaryCode)
|
||||||
|| mSettingsValues.isSymbolExcludedFromWordSeparators(primaryCode))
|
|| mSettingsValues.isSymbolExcludedFromWordSeparators(primaryCode))
|
||||||
&& isSuggestionsRequested() && !isCursorTouchingWord()) {
|
&& isSuggestionsRequested() && !isComposingWord && !isCursorTouchingWord()) {
|
||||||
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 idea here is, single quote is not a
|
||||||
// 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
|
||||||
// separator and it should be treated as a normal character, except in the first
|
// position where it should not start composing a word.
|
||||||
// position where it should not start composing a word.
|
isComposingWord = (Keyboard.CODE_SINGLE_QUOTE != primaryCode);
|
||||||
isComposingWord = (Keyboard.CODE_SINGLE_QUOTE != primaryCode);
|
// Here we don't need to reset the last composed word. It will be reset
|
||||||
// Here we don't need to reset the last composed word. It will be reset
|
// when we commit this one, if we ever do; if on the other hand we backspace
|
||||||
// when we commit this one, if we ever do; if on the other hand we backspace
|
// it entirely and resume suggestions on the previous word, we'd like to still
|
||||||
// it entirely and resume suggestions on the previous word, we'd like to still
|
// have touch coordinates for it.
|
||||||
// have touch coordinates for it.
|
resetComposingState(false /* alsoResetLastComposedWord */);
|
||||||
resetComposingState(false /* alsoResetLastComposedWord */);
|
clearSuggestions();
|
||||||
clearSuggestions();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (isComposingWord) {
|
if (isComposingWord) {
|
||||||
mWordComposer.add(
|
mWordComposer.add(
|
||||||
|
|
Loading…
Reference in a new issue