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

Commit 3952078a authored by Tom Ouyang's avatar Tom Ouyang
Browse files

Extract fewer characters in getWordRangeAtCursor().

Use LOOKBACK_CHARACTER_NUM = 80 instead of the previous
EDITOR_CONTENTS_CACHE_SIZE = 1024 (which was overkill).

This speeds up many InputLogic operations.

Bug: 19987461
Change-Id: I62b6a589f87e5daab33376b3e48f1c615a66dcfb
parent 7f386acd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -619,9 +619,9 @@ public final class RichInputConnection implements PrivateCommandPerformer {
        if (!isConnected()) {
            return null;
        }
        final CharSequence before = mIC.getTextBeforeCursor(Constants.EDITOR_CONTENTS_CACHE_SIZE,
        final CharSequence before = mIC.getTextBeforeCursor(LOOKBACK_CHARACTER_NUM,
                InputConnection.GET_TEXT_WITH_STYLES);
        final CharSequence after = mIC.getTextAfterCursor(Constants.EDITOR_CONTENTS_CACHE_SIZE,
        final CharSequence after = mIC.getTextAfterCursor(LOOKBACK_CHARACTER_NUM,
                InputConnection.GET_TEXT_WITH_STYLES);
        if (before == null || after == null) {
            return null;