am 286877b3: Merge "Fix a bug with recapitalization"

* commit '286877b3afc6309b70c5216f05b94729aeb844f3':
  Fix a bug with recapitalization
main
Jean Chalard 2013-06-17 04:50:28 -07:00 committed by Android Git Automerger
commit 188856aed0
1 changed files with 4 additions and 1 deletions

View File

@ -163,7 +163,10 @@ public class RecapitalizeStatus {
final int codePoint = mStringBefore.codePointBefore(nonWhitespaceEnd); final int codePoint = mStringBefore.codePointBefore(nonWhitespaceEnd);
if (!Character.isWhitespace(codePoint)) break; if (!Character.isWhitespace(codePoint)) break;
} }
if (0 != nonWhitespaceStart || len != nonWhitespaceEnd) { // If nonWhitespaceStart >= nonWhitespaceEnd, that means the selection contained only
// whitespace, so we leave it as is.
if ((0 != nonWhitespaceStart || len != nonWhitespaceEnd)
&& nonWhitespaceStart < nonWhitespaceEnd) {
mCursorEndAfter = mCursorStartBefore + nonWhitespaceEnd; mCursorEndAfter = mCursorStartBefore + nonWhitespaceEnd;
mCursorStartBefore = mCursorStartAfter = mCursorStartBefore + nonWhitespaceStart; mCursorStartBefore = mCursorStartAfter = mCursorStartBefore + nonWhitespaceStart;
mStringAfter = mStringBefore = mStringAfter = mStringBefore =