aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-07-25 22:33:22 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-25 22:33:22 -0700
commit25446d31f2fec5b888d9b4d73b2daf6b49dcc5eb (patch)
tree69a5e0e2b8a79088389ac44c841c753e49323ffb /java
parentd6ee1ded528aac34ede44eae7441b2de74092b97 (diff)
parent0dd23544ffec1ae50c4b56fced22b47e7772f5ed (diff)
downloadlatinime-25446d31f2fec5b888d9b4d73b2daf6b49dcc5eb.tar.gz
latinime-25446d31f2fec5b888d9b4d73b2daf6b49dcc5eb.tar.xz
latinime-25446d31f2fec5b888d9b4d73b2daf6b49dcc5eb.zip
am 0dd23544: Merge "Very simple refactoring"
* commit '0dd23544ffec1ae50c4b56fced22b47e7772f5ed': Very simple refactoring
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputConnection.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java
index 2c65e5eca..7b8ed1f94 100644
--- a/java/src/com/android/inputmethod/latin/RichInputConnection.java
+++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java
@@ -139,13 +139,17 @@ public final class RichInputConnection {
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
}
- public void resetCachesUponCursorMove(final int newCursorPosition,
- final boolean shouldFinishComposition) {
- mCurrentCursorPosition = newCursorPosition;
+ private void refreshCache() {
mComposingText.setLength(0);
mCommittedTextBeforeComposingText.setLength(0);
final CharSequence textBeforeCursor = getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE, 0);
if (null != textBeforeCursor) mCommittedTextBeforeComposingText.append(textBeforeCursor);
+ }
+
+ public void resetCachesUponCursorMove(final int newCursorPosition,
+ final boolean shouldFinishComposition) {
+ mCurrentCursorPosition = newCursorPosition;
+ refreshCache();
if (null != mIC && shouldFinishComposition) {
mIC.finishComposingText();
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {