am 6fe6f38d: am d39e6435: am f960eb18: Don\'t put spaces after characters that don\'t take one
* commit '6fe6f38d8af09b24e40a6e01eae919820cd04c16': Don't put spaces after characters that don't take onemain
commit
751f3dc0e1
|
@ -1429,8 +1429,12 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
|
||||||
mSpaceState = SPACE_STATE_PHANTOM;
|
mSpaceState = SPACE_STATE_PHANTOM;
|
||||||
} else {
|
} else {
|
||||||
final int codePointBeforeCursor = mConnection.getCodePointBeforeCursor();
|
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
|
if (Constants.NOT_A_CODE != codePointBeforeCursor
|
||||||
&& !Character.isWhitespace(codePointBeforeCursor)) {
|
&& !Character.isWhitespace(codePointBeforeCursor)
|
||||||
|
&& !mCurrentSettings.isPhantomSpacePromotingSymbol(codePointBeforeCursor)
|
||||||
|
&& !mCurrentSettings.isWeakSpaceStripper(codePointBeforeCursor)) {
|
||||||
mSpaceState = SPACE_STATE_PHANTOM;
|
mSpaceState = SPACE_STATE_PHANTOM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -254,11 +254,13 @@ public final class SettingsValues {
|
||||||
return mSymbolsExcludedFromWordSeparators.contains(String.valueOf((char)code));
|
return mSymbolsExcludedFromWordSeparators.contains(String.valueOf((char)code));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: use "Phantom" instead of "Weak" in this method name
|
||||||
public boolean isWeakSpaceStripper(final int code) {
|
public boolean isWeakSpaceStripper(final int code) {
|
||||||
// TODO: this does not work if the code does not fit in a char
|
// TODO: this does not work if the code does not fit in a char
|
||||||
return mWeakSpaceStrippers.contains(String.valueOf((char)code));
|
return mWeakSpaceStrippers.contains(String.valueOf((char)code));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: use "Phantom" instead of "Weak" in this method name
|
||||||
public boolean isWeakSpaceSwapper(final int code) {
|
public boolean isWeakSpaceSwapper(final int code) {
|
||||||
// TODO: this does not work if the code does not fit in a char
|
// TODO: this does not work if the code does not fit in a char
|
||||||
return mWeakSpaceSwappers.contains(String.valueOf((char)code));
|
return mWeakSpaceSwappers.contains(String.valueOf((char)code));
|
||||||
|
|
Loading…
Reference in New Issue