diff options
author | 2013-10-11 05:07:02 -0700 | |
---|---|---|
committer | 2013-10-11 05:07:02 -0700 | |
commit | 60fb58654e33448651fea191ba22cfdc87e37466 (patch) | |
tree | eef4a37f6a89a228e4a4ebba29b86291423a9ed6 /java/src | |
parent | 405062733cfe066c4b9af719bfc36a9a516c9dd3 (diff) | |
parent | 06e1bdaa2582293193df7c1b1dd0784b9c327b87 (diff) | |
download | latinime-60fb58654e33448651fea191ba22cfdc87e37466.tar.gz latinime-60fb58654e33448651fea191ba22cfdc87e37466.tar.xz latinime-60fb58654e33448651fea191ba22cfdc87e37466.zip |
am 06e1bdaa: am 3e35e072: Merge "Make emoji separators" into klp-dev
* commit '06e1bdaa2582293193df7c1b1dd0784b9c327b87':
Make emoji separators
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LastComposedWord.java | 6 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 7 |
2 files changed, 4 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/LastComposedWord.java b/java/src/com/android/inputmethod/latin/LastComposedWord.java index 642b3a4da..2e9280c77 100644 --- a/java/src/com/android/inputmethod/latin/LastComposedWord.java +++ b/java/src/com/android/inputmethod/latin/LastComposedWord.java @@ -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); - } } diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 35fb53e36..dc96cd750 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1710,7 +1710,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; @@ -2977,8 +2978,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) { |