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/latin/WordComposer.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/latin/WordComposer.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/WordComposer.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index cdee496a8..ac6972928 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -80,7 +80,7 @@ public final class WordComposer { private boolean mIsFirstCharCapitalized; public WordComposer() { - mCombinerChain = new CombinerChain(); + mCombinerChain = new CombinerChain(""); mEvents = CollectionUtils.newArrayList(); mAutoCorrection = null; mIsResumed = false; @@ -92,18 +92,17 @@ public final class WordComposer { } /** - * Restart input with a new combining spec. + * Restart the combiners, possibly with a new spec. * @param combiningSpec The spec string for combining. This is found in the extra value. */ - public void restart(final String combiningSpec) { + public void restartCombining(final String combiningSpec) { final String nonNullCombiningSpec = null == combiningSpec ? "" : combiningSpec; - if (nonNullCombiningSpec.equals(mCombiningSpec)) { - mCombinerChain.reset(); - } else { - mCombinerChain = new CombinerChain(CombinerChain.createCombiners(nonNullCombiningSpec)); + if (!nonNullCombiningSpec.equals(mCombiningSpec)) { + mCombinerChain = new CombinerChain( + mCombinerChain.getComposingWordWithCombiningFeedback().toString(), + CombinerChain.createCombiners(nonNullCombiningSpec)); mCombiningSpec = nonNullCombiningSpec; } - reset(); } /** |