diff options
author | 2013-05-16 18:39:40 -0700 | |
---|---|---|
committer | 2013-05-17 09:47:40 -0700 | |
commit | 500dea6ad45d82d745902103067885f58b42fddf (patch) | |
tree | 0275f0fb4a55afce2f03843de445ff45d9643721 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 17b63ba588598d0bd6f643d3a8cb385c75d2c163 (diff) | |
download | latinime-500dea6ad45d82d745902103067885f58b42fddf.tar.gz latinime-500dea6ad45d82d745902103067885f58b42fddf.tar.xz latinime-500dea6ad45d82d745902103067885f58b42fddf.zip |
Fix punctuation logging
Punctuation is currently put into the same LogUnit as the
following word. This is counter-intuitive and makes
post-processing more complicated.
This change causes punctuation to be put into its own
LogUnit.
A tricky case is the phantom space. A phantom space is
inserted right before other text, whose MotionEvents have
already been collected and inserted into mCurrentLogBuffer.
Phantom spaces are handled by creating their own LogUnit and
inserting it into the LogBuffer right before
mCurrentLogBuffer is shifted in.
Change-Id: I102d7cd93982ad37ba0abb6c1ac0f66b85b5f95d
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index ad0c1c8b3..883c9469b 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2021,9 +2021,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // Returns true if we did an autocorrection, false otherwise. private boolean handleSeparator(final int primaryCode, final int x, final int y, final int spaceState) { - if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { - ResearchLogger.latinIME_handleSeparator(primaryCode, mWordComposer.isComposingWord()); - } boolean didAutoCorrect = false; if (mWordComposer.isCursorFrontOrMiddleOfComposingWord()) { // If we are in the middle of a recorrection, we need to commit the recorrection @@ -2047,6 +2044,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mSettings.getCurrent().isUsuallyPrecededBySpace(primaryCode)) { promotePhantomSpace(); } + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { + ResearchLogger.latinIME_handleSeparator(primaryCode, mWordComposer.isComposingWord()); + } sendKeyCodePoint(primaryCode); if (Constants.CODE_SPACE == primaryCode) { @@ -2594,10 +2594,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen public void promotePhantomSpace() { if (mSettings.getCurrent().shouldInsertSpacesAutomatically() && !mConnection.textBeforeCursorLooksLikeURL()) { - sendKeyCodePoint(Constants.CODE_SPACE); if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_promotePhantomSpace(); } + sendKeyCodePoint(Constants.CODE_SPACE); } } |