aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-04-02 09:17:29 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-02 09:17:30 +0000
commit750a3557a0dd08fddc78acb6c7e3d49a0ad43da9 (patch)
tree47658409813b52ce9461403cb55b47d59e940cd7 /java/src
parentcc5a71caf1a96899f654a179eb229edacaee18f7 (diff)
parent8bb2e99aefd6d98032f00d7d7fa917220d99188a (diff)
downloadlatinime-750a3557a0dd08fddc78acb6c7e3d49a0ad43da9.tar.gz
latinime-750a3557a0dd08fddc78acb6c7e3d49a0ad43da9.tar.xz
latinime-750a3557a0dd08fddc78acb6c7e3d49a0ad43da9.zip
Merge "[CB18] Move some code around"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/WordComposer.java54
1 files changed, 27 insertions, 27 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index ad41d2a19..50bc2b0a2 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -200,6 +200,33 @@ public final class WordComposer {
mAutoCorrection = null;
}
+ /**
+ * Delete the last composing unit as a result of hitting backspace.
+ */
+ public void deleteLast(final Event event) {
+ mCombinerChain.processEvent(mEvents, event);
+ mEvents.add(event);
+ refreshTypedWordCache();
+ // We may have deleted the last one.
+ if (0 == size()) {
+ mIsFirstCharCapitalized = false;
+ }
+ if (mTrailingSingleQuotesCount > 0) {
+ --mTrailingSingleQuotesCount;
+ } else {
+ int i = mTypedWordCache.length();
+ while (i > 0) {
+ i = Character.offsetByCodePoints(mTypedWordCache, i, -1);
+ if (Constants.CODE_SINGLE_QUOTE != Character.codePointAt(mTypedWordCache, i)) {
+ break;
+ }
+ ++mTrailingSingleQuotesCount;
+ }
+ }
+ mCursorPositionWithinWord = mCodePointSize;
+ mAutoCorrection = null;
+ }
+
public void setCursorPositionWithinWord(final int posWithinWord) {
mCursorPositionWithinWord = posWithinWord;
// TODO: compute where that puts us inside the events
@@ -297,33 +324,6 @@ public final class WordComposer {
}
/**
- * Delete the last composing unit as a result of hitting backspace.
- */
- public void deleteLast(final Event event) {
- mCombinerChain.processEvent(mEvents, event);
- mEvents.add(event);
- refreshTypedWordCache();
- // We may have deleted the last one.
- if (0 == size()) {
- mIsFirstCharCapitalized = false;
- }
- if (mTrailingSingleQuotesCount > 0) {
- --mTrailingSingleQuotesCount;
- } else {
- int i = mTypedWordCache.length();
- while (i > 0) {
- i = Character.offsetByCodePoints(mTypedWordCache, i, -1);
- if (Constants.CODE_SINGLE_QUOTE != Character.codePointAt(mTypedWordCache, i)) {
- break;
- }
- ++mTrailingSingleQuotesCount;
- }
- }
- mCursorPositionWithinWord = mCodePointSize;
- mAutoCorrection = null;
- }
-
- /**
* Returns the word as it was typed, without any correction applied.
* @return the word that was typed so far. Never returns null.
*/