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

Commit 3e35e072 authored by Ken Wakasa's avatar Ken Wakasa Committed by Android (Google) Code Review
Browse files

Merge "Make emoji separators" into klp-dev

parents 6d915037 401fb908
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -16,8 +16,6 @@


package com.android.inputmethod.latin;
package com.android.inputmethod.latin;


import com.android.inputmethod.latin.utils.StringUtils;

import android.text.TextUtils;
import android.text.TextUtils;


/**
/**
@@ -85,8 +83,4 @@ public final class LastComposedWord {
    private boolean didCommitTypedWord() {
    private boolean didCommitTypedWord() {
        return TextUtils.equals(mTypedWord, mCommittedWord);
        return TextUtils.equals(mTypedWord, mCommittedWord);
    }
    }

    public static int getSeparatorLength(final String separatorString) {
        return StringUtils.codePointCount(separatorString);
    }
}
}
+4 −3
Original line number Original line Diff line number Diff line
@@ -1710,7 +1710,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
        mSpaceState = SPACE_STATE_NONE;
        mSpaceState = SPACE_STATE_NONE;
        final boolean didAutoCorrect;
        final boolean didAutoCorrect;
        final SettingsValues settingsValues = mSettings.getCurrent();
        final SettingsValues settingsValues = mSettings.getCurrent();
        if (settingsValues.isWordSeparator(primaryCode)) {
        if (settingsValues.isWordSeparator(primaryCode)
                || Character.getType(primaryCode) == Character.OTHER_SYMBOL) {
            didAutoCorrect = handleSeparator(primaryCode, x, y, spaceState);
            didAutoCorrect = handleSeparator(primaryCode, x, y, spaceState);
        } else {
        } else {
            didAutoCorrect = false;
            didAutoCorrect = false;
@@ -2977,8 +2978,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
        final String originallyTypedWord = mLastComposedWord.mTypedWord;
        final String originallyTypedWord = mLastComposedWord.mTypedWord;
        final String committedWord = mLastComposedWord.mCommittedWord;
        final String committedWord = mLastComposedWord.mCommittedWord;
        final int cancelLength = committedWord.length();
        final int cancelLength = committedWord.length();
        final int separatorLength = LastComposedWord.getSeparatorLength(
        // We want java chars, not codepoints for the following.
                mLastComposedWord.mSeparatorString);
        final int separatorLength = mLastComposedWord.mSeparatorString.length();
        // TODO: should we check our saved separator against the actual contents of the text view?
        // TODO: should we check our saved separator against the actual contents of the text view?
        final int deleteLength = cancelLength + separatorLength;
        final int deleteLength = cancelLength + separatorLength;
        if (DEBUG) {
        if (DEBUG) {