aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LastComposedWord.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-08-27 20:09:46 +0900
committerJean Chalard <jchalard@google.com>2012-08-29 16:49:39 +0900
commita05a0f20776b4c33f41f043f1bff245331937580 (patch)
tree690fd7e71cb45bf3ac119a8e4a9c03d0c779ada8 /java/src/com/android/inputmethod/latin/LastComposedWord.java
parent6c70b9200340537d05ff8932d7cd990269eb486d (diff)
downloadlatinime-a05a0f20776b4c33f41f043f1bff245331937580.tar.gz
latinime-a05a0f20776b4c33f41f043f1bff245331937580.tar.xz
latinime-a05a0f20776b4c33f41f043f1bff245331937580.zip
Allow Latin IME to cancel smiley-auto-correct consistenly
This change makes Latin IME behave consistently with regards to other auto-correction cancellations in cases of auto-correction cancellation after smiley-triggered auto-correction. That is, pressing the smiley key when the keyboard signals it's about to auto-correct will get the auto-correction there plus a smiley, and pressing backspace will cancel the auto-correction, and pressing backspace again will delete the smiley. Bug: 7067593 Change-Id: Ia7eef70a5d06b8b9afa1f1fbb0ed1dbc21a3059f
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LastComposedWord.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LastComposedWord.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/LastComposedWord.java b/java/src/com/android/inputmethod/latin/LastComposedWord.java
index bb39ce4f7..dd73a978c 100644
--- a/java/src/com/android/inputmethod/latin/LastComposedWord.java
+++ b/java/src/com/android/inputmethod/latin/LastComposedWord.java
@@ -38,12 +38,12 @@ public class LastComposedWord {
// an auto-correction.
public static final int COMMIT_TYPE_CANCEL_AUTO_CORRECT = 3;
- public static final int NOT_A_SEPARATOR = -1;
+ public static final String NOT_A_SEPARATOR = "";
public final int[] mPrimaryKeyCodes;
public final String mTypedWord;
public final String mCommittedWord;
- public final int mSeparatorCode;
+ public final String mSeparatorString;
public final CharSequence mPrevWord;
public final InputPointers mInputPointers = new InputPointers(BinaryDictionary.MAX_WORD_LENGTH);
@@ -56,14 +56,14 @@ public class LastComposedWord {
// immutable. Do not fiddle with their contents after you passed them to this constructor.
public LastComposedWord(final int[] primaryKeyCodes, final InputPointers inputPointers,
final String typedWord, final String committedWord,
- final int separatorCode, final CharSequence prevWord) {
+ final String separatorString, final CharSequence prevWord) {
mPrimaryKeyCodes = primaryKeyCodes;
if (inputPointers != null) {
mInputPointers.copy(inputPointers);
}
mTypedWord = typedWord;
mCommittedWord = committedWord;
- mSeparatorCode = separatorCode;
+ mSeparatorString = separatorString;
mActive = true;
mPrevWord = prevWord;
}
@@ -80,7 +80,7 @@ public class LastComposedWord {
return TextUtils.equals(mTypedWord, mCommittedWord);
}
- public static int getSeparatorLength(final int separatorCode) {
- return NOT_A_SEPARATOR == separatorCode ? 0 : 1;
+ public static int getSeparatorLength(final String separatorString) {
+ return StringUtils.codePointCount(separatorString);
}
}