diff options
author | 2014-05-14 11:40:54 +0000 | |
---|---|---|
committer | 2014-05-14 11:40:54 +0000 | |
commit | 05db21949fd29103a60502c235e80f339a5cd9b6 (patch) | |
tree | 712279404ec470dff240d30905ac7dc0ef9dbb5c /java/src/com/android/inputmethod/event/CombinerChain.java | |
parent | 0e40c0ce82078d58cc078a092a913e4ed4fdf326 (diff) | |
parent | babde55bf843c2262d84580c0139ed6b040bef7e (diff) | |
download | latinime-05db21949fd29103a60502c235e80f339a5cd9b6.tar.gz latinime-05db21949fd29103a60502c235e80f339a5cd9b6.tar.xz latinime-05db21949fd29103a60502c235e80f339a5cd9b6.zip |
am babde55b: Merge "Fix a bug where changing languages kills the composition."
* commit 'babde55bf843c2262d84580c0139ed6b040bef7e':
Fix a bug where changing languages kills the composition.
Diffstat (limited to 'java/src/com/android/inputmethod/event/CombinerChain.java')
-rw-r--r-- | java/src/com/android/inputmethod/event/CombinerChain.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/event/CombinerChain.java b/java/src/com/android/inputmethod/event/CombinerChain.java index 990f7deea..9e7f04d4f 100644 --- a/java/src/com/android/inputmethod/event/CombinerChain.java +++ b/java/src/com/android/inputmethod/event/CombinerChain.java @@ -56,18 +56,20 @@ public class CombinerChain { * * The combiner chain takes events as inputs and outputs code points and combining state. * For example, if the input language is Japanese, the combining chain will typically perform - * kana conversion. + * kana conversion. This takes a string for initial text, taken to be present before the + * cursor: we'll start after this. * + * @param initialText The text that has already been combined so far. * @param combinerList A list of combiners to be applied in order. */ - public CombinerChain(final Combiner... combinerList) { + public CombinerChain(final String initialText, final Combiner... combinerList) { mCombiners = CollectionUtils.newArrayList(); // The dead key combiner is always active, and always first mCombiners.add(new DeadKeyCombiner()); for (final Combiner combiner : combinerList) { mCombiners.add(combiner); } - mCombinedText = new StringBuilder(); + mCombinedText = new StringBuilder(initialText); mStateFeedback = new SpannableStringBuilder(); } |