aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-07-26 05:30:46 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-07-26 05:30:47 +0000
commit0dd23544ffec1ae50c4b56fced22b47e7772f5ed (patch)
tree4e238c5b5c2396fe7926e5de2eda97e4586ddcc4 /java
parentffcbbaf12788a9fc9398607a548e552d7d2bf05e (diff)
parentf712dc9a4f17ee4a6916b0f477e89d1bc34a4d70 (diff)
downloadlatinime-0dd23544ffec1ae50c4b56fced22b47e7772f5ed.tar.gz
latinime-0dd23544ffec1ae50c4b56fced22b47e7772f5ed.tar.xz
latinime-0dd23544ffec1ae50c4b56fced22b47e7772f5ed.zip
Merge "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) {