diff options
author | 2012-04-23 17:03:32 -0700 | |
---|---|---|
committer | 2012-04-23 17:03:32 -0700 | |
commit | fa1affbaecf4b851169294203654556cdc31ea38 (patch) | |
tree | a8ffd04f6fc8304bd7de30e697d604968db5de79 /java/src | |
parent | 5ee0ee0dbe316aac80949bd35f9834e46d5e2799 (diff) | |
parent | 551612dd9ec79c9f9a7e430801fdf430dfe625e9 (diff) | |
download | latinime-fa1affbaecf4b851169294203654556cdc31ea38.tar.gz latinime-fa1affbaecf4b851169294203654556cdc31ea38.tar.xz latinime-fa1affbaecf4b851169294203654556cdc31ea38.zip |
Merge "Fix a bug where two spaces would be added instead of one"
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index ddc710956..c6381180c 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1796,6 +1796,22 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final InputConnection ic = getCurrentInputConnection(); if (ic != null) ic.beginBatchEdit(); + // If this is a punctuation picked from the suggestion strip, pass it to onCodeInput + if (suggestion.length() == 1 && isShowingPunctuationList()) { + // Word separators are suggested before the user inputs something. + // So, LatinImeLogger logs "" as a user's input. + LatinImeLogger.logOnManualSuggestion("", suggestion.toString(), index, suggestedWords); + // Rely on onCodeInput to do the complicated swapping/stripping logic consistently. + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.latinIME_punctuationSuggestion(index, suggestion, x, y); + } + final int primaryCode = suggestion.charAt(0); + onCodeInput(primaryCode, + KeyboardActionListener.SUGGESTION_STRIP_COORDINATE, + KeyboardActionListener.SUGGESTION_STRIP_COORDINATE); + return; + } + if (SPACE_STATE_PHANTOM == mSpaceState && suggestion.length() > 0) { int firstChar = Character.codePointAt(suggestion, 0); if ((!mSettingsValues.isWeakSpaceStripper(firstChar)) @@ -1823,21 +1839,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen return; } - // If this is a punctuation picked from the suggestion strip, pass it to onCodeInput - if (suggestion.length() == 1 && isShowingPunctuationList()) { - // Word separators are suggested before the user inputs something. - // So, LatinImeLogger logs "" as a user's input. - LatinImeLogger.logOnManualSuggestion("", suggestion.toString(), index, suggestedWords); - // Rely on onCodeInput to do the complicated swapping/stripping logic consistently. - if (ProductionFlag.IS_EXPERIMENTAL) { - ResearchLogger.latinIME_punctuationSuggestion(index, suggestion, x, y); - } - final int primaryCode = suggestion.charAt(0); - onCodeInput(primaryCode, - KeyboardActionListener.SUGGESTION_STRIP_COORDINATE, - KeyboardActionListener.SUGGESTION_STRIP_COORDINATE); - return; - } // We need to log before we commit, because the word composer will store away the user // typed word. final String replacedWord = mWordComposer.getTypedWord().toString(); |