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

Commit f628629f authored by Jean Chalard's avatar Jean Chalard
Browse files

Revert "Revert "Fix a race condition.""

This reverts commit 38401272.

Change-Id: I7f0d975ec9e18d94fe3505250360c2b79ccbe96d
parent b3c51630
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1114,8 +1114,11 @@ public final class InputLogic {
                keyboardSwitcher.getKeyboard());
        mWordComposer.setCursorPositionWithinWord(
                typedWord.codePointCount(0, numberOfCharsInWordBeforeCursor));
        mConnection.setComposingRegion(expectedCursorPosition - numberOfCharsInWordBeforeCursor,
                expectedCursorPosition + range.getNumberOfCharsInWordAfterCursor());
        // TODO: Change these two lines to setComposingRegion(cursorPosition,
        //         cursorPosition + range.getNumberOfCharsInWordAfterCursor());
        mConnection.deleteSurroundingText(numberOfCharsInWordBeforeCursor,
              typedWord.length() - numberOfCharsInWordBeforeCursor);
        mConnection.setComposingText(typedWord, 1);
        if (suggestions.isEmpty()) {
            // We come here if there weren't any suggestion spans on this word. We will try to
            // compute suggestions for it instead.