Skip to content
Snippets Groups Projects
Commit f71e1db2 authored by Jean Chalard's avatar Jean Chalard
Browse files

Don't resume suggestion on digits.

Bug: 10780016
Change-Id: I94fad06e4c71eddc96bdda1765925f98bed160f3
parent 060917ed
No related branches found
No related tags found
No related merge requests found
...@@ -2685,6 +2685,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen ...@@ -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 ...@@ -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()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment