diff options
author | 2014-03-27 09:49:02 +0000 | |
---|---|---|
committer | 2014-03-27 09:49:02 +0000 | |
commit | 5a4cb0e3f863a779260f3971f382e2b732bc56c8 (patch) | |
tree | 6bbe83799902e301599522be465dfc4abda3617d /java/src/com/android/inputmethod/latin/WordComposer.java | |
parent | b3041a8210ac3ef25dba3e102ff2738882ce07cc (diff) | |
parent | f459ccf4f663d74ce43c57e9b9af9251ee0c48a1 (diff) | |
download | latinime-5a4cb0e3f863a779260f3971f382e2b732bc56c8.tar.gz latinime-5a4cb0e3f863a779260f3971f382e2b732bc56c8.tar.xz latinime-5a4cb0e3f863a779260f3971f382e2b732bc56c8.zip |
am f459ccf4: Merge "Revert "[CB16] Remove unused stuff""
* commit 'f459ccf4f663d74ce43c57e9b9af9251ee0c48a1':
Revert "[CB16] Remove unused stuff"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/WordComposer.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index 52d13770b..4638c8a8b 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -426,8 +426,9 @@ public final class WordComposer { // Note: currently, we come here whenever we commit a word. If it's a MANUAL_PICK // or a DECIDED_WORD we may cancel the commit later; otherwise, we should deactivate // the last composed word to ensure this does not happen. - final LastComposedWord lastComposedWord = new LastComposedWord( - mTypedWord.toString(), committedWord, separatorString, prevWord, mCapitalizedMode); + final LastComposedWord lastComposedWord = new LastComposedWord(mEvents, + mInputPointers, mTypedWord.toString(), committedWord, separatorString, + prevWord, mCapitalizedMode); mInputPointers.reset(); if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD && type != LastComposedWord.COMMIT_TYPE_MANUAL_PICK) { @@ -458,6 +459,24 @@ public final class WordComposer { public void discardPreviousWordForSuggestion() { mPreviousWordForSuggestion = null; } + + public void resumeSuggestionOnLastComposedWord(final LastComposedWord lastComposedWord, + final String previousWord) { + mEvents.clear(); + Collections.copy(mEvents, lastComposedWord.mEvents); + mInputPointers.set(lastComposedWord.mInputPointers); + mTypedWord.setLength(0); + mCombinerChain.reset(); + mTypedWord.append(lastComposedWord.mTypedWord); + refreshSize(); + mCapitalizedMode = lastComposedWord.mCapitalizedMode; + mAutoCorrection = null; // This will be filled by the next call to updateSuggestion. + mCursorPositionWithinWord = mCodePointSize; + mRejectedBatchModeSuggestion = null; + mIsResumed = true; + mPreviousWordForSuggestion = previousWord; + } + public boolean isBatchMode() { return mIsBatchMode; } |