Skip to content
Snippets Groups Projects
Commit 38e98026 authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge "Revert "Very simple refactoring""

parents 0dd23544 c6a07e16
No related branches found
No related tags found
No related merge requests found
......@@ -139,17 +139,13 @@ public final class RichInputConnection {
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
}
private void refreshCache() {
public void resetCachesUponCursorMove(final int newCursorPosition,
final boolean shouldFinishComposition) {
mCurrentCursorPosition = newCursorPosition;
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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment