make selection upon doubleclick more mac like

This commit is contained in:
daboe01 committed 2015-12-30 15:41:36 +01:00
1 parent bc80fe693a
commit 44cef002ed
1 file changed
+6
+6
View File
@@ -780,6 +780,9 @@ var kDelegateRespondsTo_textShouldBeginEditing
switch (granularity)
{
case CPSelectByWord:
if (_isNewlineCharacter([string characterAtIndex:proposedRange.location]))
return CPMakeRange(proposedRange.location, 1);
var wordRange = [self _characterRangeForIndex:proposedRange.location inRange:proposedRange asDefinedByRegex:[[self class] _wordBoundaryRegex] skip:YES];
if (proposedRange.length)
@@ -788,6 +791,9 @@ var kDelegateRespondsTo_textShouldBeginEditing
return wordRange;
case CPSelectByParagraph:
if (_isNewlineCharacter([string characterAtIndex:proposedRange.location]))
return CPMakeRange(proposedRange.location, 1);
var parRange = [self _characterRangeForIndex:proposedRange.location inRange:proposedRange asDefinedByRegex:[[self class] _paragraphBoundaryRegex] skip:YES];
if (proposedRange.length)