diff options
author | 2012-12-14 11:01:56 -0800 | |
---|---|---|
committer | 2012-12-14 11:01:56 -0800 | |
commit | d48d6feedd18f0fe334e8f167c5b0ff240a402ea (patch) | |
tree | eb894b8ac0b7f5a1a0e501704a6defe8c0f19fe9 /java/src/com/android/inputmethod/latin/RichInputConnection.java | |
parent | f33c33097bafd263ec1c1fe1515c42f8569a6e1d (diff) | |
parent | db6f21c6792fe07a733572e1d4978f46b5462c35 (diff) | |
download | latinime-d48d6feedd18f0fe334e8f167c5b0ff240a402ea.tar.gz latinime-d48d6feedd18f0fe334e8f167c5b0ff240a402ea.tar.xz latinime-d48d6feedd18f0fe334e8f167c5b0ff240a402ea.zip |
am db6f21c6: am 18d688c9: Use the amended user dictionary word for insertion
* commit 'db6f21c6792fe07a733572e1d4978f46b5462c35':
Use the amended user dictionary word for insertion
Diffstat (limited to 'java/src/com/android/inputmethod/latin/RichInputConnection.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/RichInputConnection.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index 75b67bfc6..3b732278b 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -339,6 +339,24 @@ public final class RichInputConnection { } } + public void setComposingRegion(final int start, final int end) { + if (DEBUG_BATCH_NESTING) checkBatchEdit(); + if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug(); + mCurrentCursorPosition = end; + final CharSequence textBeforeCursor = + getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE + (end - start), 0); + final int indexOfStartOfComposingText = + Math.max(textBeforeCursor.length() - (end - start), 0); + mComposingText.append(textBeforeCursor.subSequence(indexOfStartOfComposingText, + textBeforeCursor.length())); + mCommittedTextBeforeComposingText.setLength(0); + mCommittedTextBeforeComposingText.append( + textBeforeCursor.subSequence(0, indexOfStartOfComposingText)); + if (null != mIC) { + mIC.setComposingRegion(start, end); + } + } + public void setComposingText(final CharSequence text, final int i) { if (DEBUG_BATCH_NESTING) checkBatchEdit(); if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug(); |