Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d43d656d authored by Raph Levien's avatar Raph Levien Committed by Android Git Automerger
Browse files

am 8ece858f: am 02366924: am a3e8bd63: Merge "Defer spelling correction with...

am 8ece858f: am 02366924: am a3e8bd63: Merge "Defer spelling correction with apostrophe" into lmp-dev

* commit '8ece858ff57cbb80a99d1c4d440748c72e690b1e':
  Defer spelling correction with apostrophe
parents 4edea3b8 a4e3a616
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -276,13 +276,19 @@ public class SpellChecker implements SpellCheckerSessionListener {

            // Do not check this word if the user is currently editing it
            final boolean isEditing;

            // Defer spell check when typing a word with an interior apostrophe.
            // TODO: a better solution to this would be to make the word
            // iterator locale-sensitive and include the apostrophe in
            // languages that use it (such as English).
            final boolean apostrophe = (selectionStart == end + 1 && editable.charAt(end) == '\'');
            if (mIsSentenceSpellCheckSupported) {
                // Allow the overlap of the cursor and the first boundary of the spell check span
                // no to skip the spell check of the following word because the
                // following word will never be spell-checked even if the user finishes composing
                isEditing = selectionEnd <= start || selectionStart > end;
                isEditing = !apostrophe && (selectionEnd <= start || selectionStart > end);
            } else {
                isEditing = selectionEnd < start || selectionStart > end;
                isEditing = !apostrophe && (selectionEnd < start || selectionStart > end);
            }
            if (start >= 0 && end > start && isEditing) {
                spellCheckSpan.setSpellCheckInProgress(true);