Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d39e6435 authored by Jean Chalard's avatar Jean Chalard Committed by Android Git Automerger
Browse files

am f960eb18: Don\'t put spaces after characters that don\'t take one

* commit 'f960eb18':
  Don't put spaces after characters that don't take one
parents 5b095509 f960eb18
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1431,8 +1431,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;
            }
        }
+2 −0
Original line number Diff line number Diff line
@@ -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));