diff options
author | 2014-10-15 14:02:32 +0900 | |
---|---|---|
committer | 2014-10-15 06:15:02 +0000 | |
commit | ecea8551c39a497e036be5c010d7ddb6b51a36bc (patch) | |
tree | a29743948e1b2fb9be752b580bfb0a4652825e4a /java/src/com/android/inputmethod/latin/inputlogic | |
parent | ae3ad8ebdd1a3239e17fd14e50a8e9670cb5b61a (diff) | |
download | latinime-ecea8551c39a497e036be5c010d7ddb6b51a36bc.tar.gz latinime-ecea8551c39a497e036be5c010d7ddb6b51a36bc.tar.xz latinime-ecea8551c39a497e036be5c010d7ddb6b51a36bc.zip |
Fix a bug with no suggestions flag
We should reset the composition state when moving the cursor inside
the word after a gesture when the text field specifies no suggestions.
Bug: 17959921
Change-Id: I977fea775f7b7e145e343636f0fb94266a40953a
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 21e2a1c10..fdab7f25f 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -358,10 +358,11 @@ public final class InputLogic { * @param oldSelEnd old selection end * @param newSelStart new selection start * @param newSelEnd new selection end + * @param settingsValues the current values of the settings. * @return whether the cursor has moved as a result of user interaction. */ public boolean onUpdateSelection(final int oldSelStart, final int oldSelEnd, - final int newSelStart, final int newSelEnd) { + final int newSelStart, final int newSelEnd, final SettingsValues settingsValues) { if (mConnection.isBelatedExpectedUpdate(oldSelStart, newSelStart, oldSelEnd, newSelEnd)) { return false; } @@ -386,8 +387,9 @@ public final class InputLogic { // should be true, but that is if the framework had taken that wrong cursor position // into account, which means we have to reset the entire composing state whenever there // is or was a selection regardless of whether it changed or not. - if (hasOrHadSelection || (selectionChangedOrSafeToReset - && !mWordComposer.moveCursorByAndReturnIfInsideComposingWord(moveAmount))) { + if (hasOrHadSelection || !settingsValues.needsToLookupSuggestions() + || (selectionChangedOrSafeToReset + && !mWordComposer.moveCursorByAndReturnIfInsideComposingWord(moveAmount))) { // If we are composing a word and moving the cursor, we would want to set a // suggestion span for recorrection to work correctly. Unfortunately, that // would involve the keyboard committing some new text, which would move the |