mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Fix a bug with single quotes
I14dd3815 special-cased single quotes at the start of a word, but did not do so correctly - it would kill a composing word if entered just after some punctuations. The right test was not isCursorTouchingWord() but mHasUncommittedTypedChars, which actually makes for a simpler implementation. Bug: 5648032 Change-Id: Icd21d213e0cad6da68cacfeb921502cd8dcfac95
This commit is contained in:
parent
f3afe5ed0a
commit
6d1cbbc2ff
@ -1539,16 +1539,15 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
|||||||
if ((isAlphabet(code) || mSettingsValues.isSymbolExcludedFromWordSeparators(code))
|
if ((isAlphabet(code) || mSettingsValues.isSymbolExcludedFromWordSeparators(code))
|
||||||
&& isSuggestionsRequested() && !isCursorTouchingWord()) {
|
&& isSuggestionsRequested() && !isCursorTouchingWord()) {
|
||||||
if (!mHasUncommittedTypedChars) {
|
if (!mHasUncommittedTypedChars) {
|
||||||
mHasUncommittedTypedChars = true;
|
// 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);
|
||||||
mComposingStringBuilder.setLength(0);
|
mComposingStringBuilder.setLength(0);
|
||||||
mWordComposer.reset();
|
mWordComposer.reset();
|
||||||
clearSuggestions();
|
clearSuggestions();
|
||||||
mComposingStateManager.onFinishComposingText();
|
mComposingStateManager.onFinishComposingText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (code == Keyboard.CODE_SINGLE_QUOTE && !isCursorTouchingWord()) {
|
|
||||||
mHasUncommittedTypedChars = false;
|
|
||||||
}
|
|
||||||
final KeyboardSwitcher switcher = mKeyboardSwitcher;
|
final KeyboardSwitcher switcher = mKeyboardSwitcher;
|
||||||
if (switcher.isShiftedOrShiftLocked()) {
|
if (switcher.isShiftedOrShiftLocked()) {
|
||||||
if (keyCodes == null || keyCodes[0] < Character.MIN_CODE_POINT
|
if (keyCodes == null || keyCodes[0] < Character.MIN_CODE_POINT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user