@@ -183,18 +183,16 @@ public void onGetSuggestions(SuggestionsInfo[] results) {
183183
184184 if (!isInDictionary && looksLikeTypo ) {
185185 String [] suggestions = getSuggestions (suggestionsInfo );
186- if (suggestions .length > 0 ) {
187- SuggestionSpan suggestionSpan = new SuggestionSpan (
188- mTextView .getContext (), suggestions ,
189- SuggestionSpan .FLAG_EASY_CORRECT |
190- SuggestionSpan .FLAG_MISSPELLED );
191- final int start = editable .getSpanStart (spellCheckSpan );
192- final int end = editable .getSpanEnd (spellCheckSpan );
193- editable .setSpan (suggestionSpan , start , end ,
194- Spanned .SPAN_EXCLUSIVE_EXCLUSIVE );
195- // TODO limit to the word rectangle region
196- mTextView .invalidate ();
197- }
186+ SuggestionSpan suggestionSpan = new SuggestionSpan (
187+ mTextView .getContext (), suggestions ,
188+ SuggestionSpan .FLAG_EASY_CORRECT |
189+ SuggestionSpan .FLAG_MISSPELLED );
190+ final int start = editable .getSpanStart (spellCheckSpan );
191+ final int end = editable .getSpanEnd (spellCheckSpan );
192+ editable .setSpan (suggestionSpan , start , end ,
193+ Spanned .SPAN_EXCLUSIVE_EXCLUSIVE );
194+ // TODO limit to the word rectangle region
195+ mTextView .invalidate ();
198196 }
199197 editable .removeSpan (spellCheckSpan );
200198 }
0 commit comments