File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -457,7 +457,16 @@ private void removeRangeSpan(Editable editable) {
457457 public void parse () {
458458 Editable editable = (Editable ) mTextView .getText ();
459459 // Iterate over the newly added text and schedule new SpellCheckSpans
460- final int start = editable .getSpanStart (mRange );
460+ final int start ;
461+ if (mIsSentenceSpellCheckSupported ) {
462+ // TODO: Find the start position of the sentence.
463+ // Set span with the context
464+ start = Math .max (
465+ 0 , editable .getSpanStart (mRange ) - MIN_SENTENCE_LENGTH );
466+ } else {
467+ start = editable .getSpanStart (mRange );
468+ }
469+
461470 final int end = editable .getSpanEnd (mRange );
462471
463472 int wordIteratorWindowEnd = Math .min (end , start + WORD_ITERATOR_INTERVAL );
@@ -512,9 +521,7 @@ public void parse() {
512521 return ;
513522 }
514523 // TODO: Find the start position of the sentence.
515- // Set span with the context
516- final int spellCheckStart = Math .max (
517- 0 , Math .min (wordStart , regionEnd - MIN_SENTENCE_LENGTH ));
524+ final int spellCheckStart = wordStart ;
518525 if (regionEnd <= spellCheckStart ) {
519526 return ;
520527 }
You can’t perform that action at this time.
0 commit comments