am 38d31a5e: Display predictions when the cursor is moved after a word.

* commit '38d31a5e79c64e706e1698d2d24adb51c4ac53aa':
  Display predictions when the cursor is moved after a word.
This commit is contained in:
Jean Chalard 2014-02-10 06:24:06 -08:00 committed by Android Git Automerger
commit 7a99f741d6

View File

@ -1256,7 +1256,14 @@ public final class InputLogic {
// If we don't know the cursor location, return. // If we don't know the cursor location, return.
if (mConnection.getExpectedSelectionStart() < 0) return; if (mConnection.getExpectedSelectionStart() < 0) return;
final int expectedCursorPosition = mConnection.getExpectedSelectionStart(); final int expectedCursorPosition = mConnection.getExpectedSelectionStart();
if (!mConnection.isCursorTouchingWord(settingsValues.mSpacingAndPunctuations)) return; if (!mConnection.isCursorTouchingWord(settingsValues.mSpacingAndPunctuations)) {
// Show predictions.
mWordComposer.setCapitalizedModeAndPreviousWordAtStartComposingTime(
WordComposer.CAPS_MODE_OFF,
getNthPreviousWordForSuggestion(settingsValues.mSpacingAndPunctuations, 1));
mLatinIME.mHandler.postUpdateSuggestionStrip();
return;
}
final TextRange range = mConnection.getWordRangeAtCursor( final TextRange range = mConnection.getWordRangeAtCursor(
settingsValues.mSpacingAndPunctuations.mSortedWordSeparators, settingsValues.mSpacingAndPunctuations.mSortedWordSeparators,
0 /* additionalPrecedingWordsCount */); 0 /* additionalPrecedingWordsCount */);