Skip to content
Snippets Groups Projects
Commit 286877b3 authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge "Fix a bug with recapitalization"

parents 6bfeeb86 2a81943d
No related branches found
No related tags found
No related merge requests found
......@@ -163,7 +163,10 @@ public class RecapitalizeStatus {
final int codePoint = mStringBefore.codePointBefore(nonWhitespaceEnd);
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;
mCursorStartBefore = mCursorStartAfter = mCursorStartBefore + nonWhitespaceStart;
mStringAfter = mStringBefore =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment