Have double-space-to-period cancel leave a single space

Bug: 8911898
Change-Id: Ifb4bb63c14dc960d0a53f1511908830093cca012
main
Jean Chalard 2013-08-07 16:26:28 +09:00
parent 0f75be4a80
commit 522d13c302
1 changed files with 4 additions and 2 deletions

View File

@ -654,9 +654,11 @@ public final class RichInputConnection {
+ "\"" + periodSpace + "\" just before the cursor."); + "\"" + periodSpace + "\" just before the cursor.");
return false; 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); deleteSurroundingText(2, 0);
final String doubleSpace = " "; final String singleSpace = " ";
commitText(doubleSpace, 1); commitText(singleSpace, 1);
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
ResearchLogger.richInputConnection_revertDoubleSpacePeriod(); ResearchLogger.richInputConnection_revertDoubleSpacePeriod();
} }