aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-05-15 12:46:44 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-05-15 12:46:44 -0700
commitd942e6e67581ce2f111c96d6179b5df25b282b38 (patch)
tree50668dd3219c4e643eee9275060ba61a885fdda1 /java/src
parent06579eda3f6990a4b175abe97e7049fa5fb77e09 (diff)
parent0633a208bcb66afdb32de5b36329c4d559008881 (diff)
downloadlatinime-d942e6e67581ce2f111c96d6179b5df25b282b38.tar.gz
latinime-d942e6e67581ce2f111c96d6179b5df25b282b38.tar.xz
latinime-d942e6e67581ce2f111c96d6179b5df25b282b38.zip
am 0633a208: am 2afe88b8: Merge "Unify space-adding on gestures."
* commit '0633a208bcb66afdb32de5b36329c4d559008881': Unify space-adding on gestures.
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java22
1 files changed, 7 insertions, 15 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 953ec310a..84c752934 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1577,21 +1577,11 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
commitTyped(LastComposedWord.NOT_A_SEPARATOR);
}
mExpectingUpdateSelection = true;
- // The following is necessary for the case where the user typed something but didn't
- // manual pick it and didn't input any separator: we want to put a space between what
- // has been entered and the coming gesture input result, so we go into phantom space
- // state, which will be promoted to a space when the gesture result is committed. But if
- // the current input ends in a word connector on the other hand, then we want to have
- // the next input stick to the current input so we don't switch to phantom space state.
- if (!mSettings.getCurrent().isWordConnector(lastChar)) {
- mSpaceState = SPACE_STATE_PHANTOM;
- }
- } else {
- final int codePointBeforeCursor = mConnection.getCodePointBeforeCursor();
- if (Character.isLetter(codePointBeforeCursor)
- || mSettings.getCurrent().isUsuallyFollowedBySpace(codePointBeforeCursor)) {
- mSpaceState = SPACE_STATE_PHANTOM;
- }
+ }
+ final int codePointBeforeCursor = mConnection.getCodePointBeforeCursor();
+ if (Character.isLetterOrDigit(codePointBeforeCursor)
+ || mSettings.getCurrent().isUsuallyFollowedBySpace(codePointBeforeCursor)) {
+ mSpaceState = SPACE_STATE_PHANTOM;
}
mConnection.endBatchEdit();
mWordComposer.setCapitalizedModeAtStartComposingTime(getActualCapsMode());
@@ -1905,6 +1895,8 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
final int y, final int spaceState) {
boolean isComposingWord = mWordComposer.isComposingWord();
+ // TODO: remove isWordConnector() and use isUsuallyFollowedBySpace() instead.
+ // See onStartBatchInput() to see how to do it.
if (SPACE_STATE_PHANTOM == spaceState &&
!mSettings.getCurrent().isWordConnector(primaryCode)) {
if (isComposingWord) {