fixed: double clicking right to a word selected too much in some cases

This commit is contained in:
daboe01 committed 2016-06-11 17:16:06 +02:00
1 parent c628ea34b7
commit e1cb11da22
1 file changed
+5 -4
+5 -4
View File
@@ -1868,15 +1868,16 @@ var kDelegateRespondsTo_textShouldBeginEditing
break;
case CPSelectByParagraph:
regex = [[self class] _paragraphBoundaryRegex];
// triple click right in last line of a paragraph-> select this paragraph completely
if (loc > 0 && _isNewlineCharacter([string characterAtIndex:loc]))
loc--;
break;
default:
return proposedRange;
}
// triple click right in last line of a paragraph-> select this paragraph completely
if (loc > 0 && _isNewlineCharacter([string characterAtIndex:loc]))
loc--;
var granularRange = [self _characterRangeForIndex:loc inRange:proposedRange asDefinedByRegex:regex skip:YES];
if (proposedRange.length == 0 && _isNewlineCharacter([string characterAtIndex:proposedRange.location]))