From 522d13c302e360cd4984b9164a9fc81bdc64feac Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 7 Aug 2013 16:26:28 +0900 Subject: [PATCH] Have double-space-to-period cancel leave a single space Bug: 8911898 Change-Id: Ifb4bb63c14dc960d0a53f1511908830093cca012 --- .../com/android/inputmethod/latin/RichInputConnection.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index b69e3f8d2..35920f8cb 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -654,9 +654,11 @@ public final class RichInputConnection { + "\"" + periodSpace + "\" just before the cursor."); return false; } + // Double-space results in ". ". A backspace to cancel this should result in a single + // space in the text field, so we replace ". " with a single space. deleteSurroundingText(2, 0); - final String doubleSpace = " "; - commitText(doubleSpace, 1); + final String singleSpace = " "; + commitText(singleSpace, 1); if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.richInputConnection_revertDoubleSpacePeriod(); }