Fix a bug with surrogate pairs

Bug: 10316781
Change-Id: I528c59c8823cda11975cb01b0ae59f12cfadef3b
main
Jean Chalard 2013-08-14 16:00:28 +09:00
parent 53830bf464
commit a74ae9c451
1 changed files with 2 additions and 2 deletions

View File

@ -2555,8 +2555,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
mWordComposer.setComposingWord(typedWord, mKeyboardSwitcher.getKeyboard());
// TODO: this is in chars but the callee expects code points!
mWordComposer.setCursorPositionWithinWord(numberOfCharsInWordBeforeCursor);
mWordComposer.setCursorPositionWithinWord(
typedWord.codePointCount(0, numberOfCharsInWordBeforeCursor));
mConnection.setComposingRegion(
mLastSelectionStart - numberOfCharsInWordBeforeCursor,
mLastSelectionEnd + range.getNumberOfCharsInWordAfterCursor());