am 60fb5865: am 06e1bdaa: am 3e35e072: Merge "Make emoji separators" into klp-dev

* commit '60fb58654e33448651fea191ba22cfdc87e37466':
  Make emoji separators
This commit is contained in:
Ken Wakasa 2013-10-11 05:10:21 -07:00 committed by Android Git Automerger
commit fe97ff4083
2 changed files with 4 additions and 9 deletions

View file

@ -16,8 +16,6 @@
package com.android.inputmethod.latin;
import com.android.inputmethod.latin.utils.StringUtils;
import android.text.TextUtils;
/**
@ -85,8 +83,4 @@ public final class LastComposedWord {
private boolean didCommitTypedWord() {
return TextUtils.equals(mTypedWord, mCommittedWord);
}
public static int getSeparatorLength(final String separatorString) {
return StringUtils.codePointCount(separatorString);
}
}

View file

@ -1711,7 +1711,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mSpaceState = SPACE_STATE_NONE;
final boolean didAutoCorrect;
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);
} else {
didAutoCorrect = false;
@ -2978,8 +2979,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final String originallyTypedWord = mLastComposedWord.mTypedWord;
final String committedWord = mLastComposedWord.mCommittedWord;
final int cancelLength = committedWord.length();
final int separatorLength = LastComposedWord.getSeparatorLength(
mLastComposedWord.mSeparatorString);
// We want java chars, not codepoints for the following.
final int separatorLength = mLastComposedWord.mSeparatorString.length();
// TODO: should we check our saved separator against the actual contents of the text view?
final int deleteLength = cancelLength + separatorLength;
if (DEBUG) {