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

Commit 72b358aa authored by Jean Chalard's avatar Jean Chalard
Browse files

Small optimization.

This will avoid some two-way IPC calls.

Change-Id: If9eb3e99b3d08346aadd4bbed2a1761f8c2527b9
parent 32b56fd3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1075,12 +1075,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen

    private boolean maybeDoubleSpace() {
        if (mCurrentSettings.mCorrectionMode == Suggest.CORRECTION_NONE) return false;
        if (!mHandler.isAcceptingDoubleSpaces()) return false;
        final CharSequence lastThree = mConnection.getTextBeforeCursor(3, 0);
        if (lastThree != null && lastThree.length() == 3
                && canBeFollowedByPeriod(lastThree.charAt(0))
                && lastThree.charAt(1) == Keyboard.CODE_SPACE
                && lastThree.charAt(2) == Keyboard.CODE_SPACE
                && mHandler.isAcceptingDoubleSpaces()) {
                && lastThree.charAt(2) == Keyboard.CODE_SPACE) {
            mHandler.cancelDoubleSpacesTimer();
            mConnection.deleteSurroundingText(2, 0);
            mConnection.commitText(". ", 1);