aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-06-25 05:00:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-06-25 05:00:11 +0000
commit10585620bdfad418f6c093ab4bfd8efaa2d84abf (patch)
tree8c27b7cfaa97bdca6ecf217a24d53af56d819991 /java/src/com/android/inputmethod/latin/LatinIME.java
parent1fc6b800095e2f630b006a61cea5f23feefb9a63 (diff)
parente5dee0af4ae991988919b2c5b80c10a94b26884e (diff)
downloadlatinime-10585620bdfad418f6c093ab4bfd8efaa2d84abf.tar.gz
latinime-10585620bdfad418f6c093ab4bfd8efaa2d84abf.tar.xz
latinime-10585620bdfad418f6c093ab4bfd8efaa2d84abf.zip
Merge "Fix a bug in the cached cursor pos, and simplify selection handling"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 0efe0eba7..3b4bb1913 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -926,19 +926,15 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
- // TODO: refactor the following code to be less contrived.
- // "newSelStart != composingSpanEnd" || "newSelEnd != composingSpanEnd" means
- // that the cursor is not at the end of the composing span, or there is a selection.
- // "mLastSelectionStart != newSelStart" means that the cursor is not in the same place
- // as last time we were called (if there is a selection, it means the start hasn't
- // changed, so it's the end that did).
- final boolean selectionChanged = (newSelStart != composingSpanEnd
- || newSelEnd != composingSpanEnd) && mLastSelectionStart != newSelStart;
+ final boolean selectionChanged = mLastSelectionStart != newSelStart
+ || mLastSelectionEnd != newSelEnd;
// if composingSpanStart and composingSpanEnd are -1, it means there is no composing
// span in the view - we can use that to narrow down whether the cursor was moved
// by us or not. If we are composing a word but there is no composing span, then
// we know for sure the cursor moved while we were composing and we should reset
- // the state.
+ // the state. TODO: rescind this policy: the framework never removes the composing
+ // span on its own accord while editing. This test is useless.
+
final boolean noComposingSpan = composingSpanStart == -1 && composingSpanEnd == -1;
// If the keyboard is not visible, we don't need to do all the housekeeping work, as it
// will be reset when the keyboard shows up anyway.
@@ -979,6 +975,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (isSuggestionsStripVisible()) {
mHandler.postResumeSuggestions();
}
+ mConnection.userMovedCursor(newSelEnd);
// Reset the last recapitalization.
mRecapitalizeStatus.deactivate();
mKeyboardSwitcher.updateShiftState();