aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-07-01 00:14:12 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-01 00:14:12 -0700
commit0ae2498bbb9cdf7b28bad086646fce409946bd47 (patch)
treecae3c14e67677aebcd8d1c8cef617d5be292b891 /java/src/com/android/inputmethod/latin/LatinIME.java
parent544e36d961b05e328e0fc371e1d48cdac968a460 (diff)
parent70ee2201a09af63f9fc87b408cc9b48c25a39605 (diff)
downloadlatinime-0ae2498bbb9cdf7b28bad086646fce409946bd47.tar.gz
latinime-0ae2498bbb9cdf7b28bad086646fce409946bd47.tar.xz
latinime-0ae2498bbb9cdf7b28bad086646fce409946bd47.zip
am 70ee2201: Merge "Do not re-resume suggestion if it\'s not needed."
* commit '70ee2201a09af63f9fc87b408cc9b48c25a39605': Do not re-resume suggestion if it's not needed.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 0560cf528..f3fc3177b 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -961,7 +961,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// TODO: is it still necessary to test for composingSpan related stuff?
final boolean selectionChangedOrSafeToReset = selectionChanged
|| (!mWordComposer.isComposingWord()) || noComposingSpan;
- if (selectionChangedOrSafeToReset) {
+ final boolean hasOrHadSelection = (oldSelStart != oldSelEnd
+ || newSelStart != newSelEnd);
+ final int moveAmount = newSelStart - oldSelStart;
+ if (selectionChangedOrSafeToReset && (hasOrHadSelection
+ || !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
@@ -2535,6 +2539,7 @@ 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);
mConnection.setComposingRegion(
mLastSelectionStart - numberOfCharsInWordBeforeCursor,