mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Don't resume suggestion on digits.
Bug: 10780016 Change-Id: I94fad06e4c71eddc96bdda1765925f98bed160f3
This commit is contained in:
parent
060917ed9a
commit
f71e1db2da
@ -2685,6 +2685,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
return prevWord;
|
return prevWord;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isResumableWord(final String word, final SettingsValues settings) {
|
||||||
|
final int firstCodePoint = word.codePointAt(0);
|
||||||
|
return settings.isWordCodePoint(firstCodePoint)
|
||||||
|
&& Constants.CODE_SINGLE_QUOTE != firstCodePoint
|
||||||
|
&& Constants.CODE_DASH != firstCodePoint;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the cursor is touching a word. If so, restart suggestions on this word, else
|
* Check if the cursor is touching a word. If so, restart suggestions on this word, else
|
||||||
* do nothing.
|
* do nothing.
|
||||||
@ -2714,6 +2721,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
if (numberOfCharsInWordBeforeCursor > mLastSelectionStart) return;
|
if (numberOfCharsInWordBeforeCursor > mLastSelectionStart) return;
|
||||||
final ArrayList<SuggestedWordInfo> suggestions = CollectionUtils.newArrayList();
|
final ArrayList<SuggestedWordInfo> suggestions = CollectionUtils.newArrayList();
|
||||||
final String typedWord = range.mWord.toString();
|
final String typedWord = range.mWord.toString();
|
||||||
|
if (!isResumableWord(typedWord, currentSettings)) return;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (final SuggestionSpan span : range.getSuggestionSpansAtWord()) {
|
for (final SuggestionSpan span : range.getSuggestionSpansAtWord()) {
|
||||||
for (final String s : span.getSuggestions()) {
|
for (final String s : span.getSuggestions()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user