diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 5cc9f5199..b4d36a64c 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1429,8 +1429,12 @@ public final class LatinIME extends InputMethodService implements KeyboardAction mSpaceState = SPACE_STATE_PHANTOM; } else { final int codePointBeforeCursor = mConnection.getCodePointBeforeCursor(); + // TODO: reverse this logic. We should have the means to determine whether a character + // should usually be followed by a space, and it should be more readable. if (Constants.NOT_A_CODE != codePointBeforeCursor - && !Character.isWhitespace(codePointBeforeCursor)) { + && !Character.isWhitespace(codePointBeforeCursor) + && !mCurrentSettings.isPhantomSpacePromotingSymbol(codePointBeforeCursor) + && !mCurrentSettings.isWeakSpaceStripper(codePointBeforeCursor)) { mSpaceState = SPACE_STATE_PHANTOM; } } diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java index 1c5864bce..2a778aa0d 100644 --- a/java/src/com/android/inputmethod/latin/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/SettingsValues.java @@ -254,11 +254,13 @@ public final class SettingsValues { return mSymbolsExcludedFromWordSeparators.contains(String.valueOf((char)code)); } + // TODO: use "Phantom" instead of "Weak" in this method name public boolean isWeakSpaceStripper(final int code) { // TODO: this does not work if the code does not fit in a char return mWeakSpaceStrippers.contains(String.valueOf((char)code)); } + // TODO: use "Phantom" instead of "Weak" in this method name public boolean isWeakSpaceSwapper(final int code) { // TODO: this does not work if the code does not fit in a char return mWeakSpaceSwappers.contains(String.valueOf((char)code));