diff options
author | 2012-12-23 15:12:51 -0800 | |
---|---|---|
committer | 2013-01-09 16:02:37 -0800 | |
commit | 3b95eaf70b0a11b1c6e0c52361fe738b4a4b2ace (patch) | |
tree | 9f3bb80f7e4fd39b4e999c2013f40816abedde3e /java/src/com/android/inputmethod/latin/RichInputConnection.java | |
parent | 125ad2237072745e4800b7a3907d5507024f35e5 (diff) | |
download | latinime-3b95eaf70b0a11b1c6e0c52361fe738b4a4b2ace.tar.gz latinime-3b95eaf70b0a11b1c6e0c52361fe738b4a4b2ace.tar.xz latinime-3b95eaf70b0a11b1c6e0c52361fe738b4a4b2ace.zip |
[Rlog50] capture bigrams properly even with deletions
multi-project commit with Ia4ec213e8356897807cb6a278fccdbaa945732f0
Change-Id: Ib3fe886dc889954a31586ab81d00a21d8d55efd2
Diffstat (limited to 'java/src/com/android/inputmethod/latin/RichInputConnection.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/RichInputConnection.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index 0d3ebacb1..f7268fc33 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -648,19 +648,20 @@ public final class RichInputConnection { // Here we test whether we indeed have a period and a space before us. This should not // be needed, but it's there just in case something went wrong. final CharSequence textBeforeCursor = getTextBeforeCursor(2, 0); - if (!". ".equals(textBeforeCursor)) { + final String periodSpace = ". "; + if (!periodSpace.equals(textBeforeCursor)) { // Theoretically we should not be coming here if there isn't ". " before the // cursor, but the application may be changing the text while we are typing, so // anything goes. We should not crash. Log.d(TAG, "Tried to revert double-space combo but we didn't find " - + "\". \" just before the cursor."); + + "\"" + periodSpace + "\" just before the cursor."); return false; } deleteSurroundingText(2, 0); final String doubleSpace = " "; commitText(doubleSpace, 1); if (ProductionFlag.IS_EXPERIMENTAL) { - ResearchLogger.richInputConnection_revertDoubleSpacePeriod(doubleSpace); + ResearchLogger.richInputConnection_revertDoubleSpacePeriod(); } return true; } @@ -685,7 +686,7 @@ public final class RichInputConnection { final String text = " " + textBeforeCursor.subSequence(0, 1); commitText(text, 1); if (ProductionFlag.IS_EXPERIMENTAL) { - ResearchLogger.richInputConnection_revertSwapPunctuation(text); + ResearchLogger.richInputConnection_revertSwapPunctuation(); } return true; } |