mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-10 18:52:19 +00:00
make selection upon doubleclick more mac like
This commit is contained in:
1 parent
bc80fe693a
commit
44cef002ed
1 file changed
+6
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user