From e1cb11da2262cc452389ab07f50ab5d5969fa9c8 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sat, 11 Jun 2016 17:16:06 +0200 Subject: [PATCH] fixed: double clicking right to a word selected too much in some cases --- AppKit/CPTextView/CPTextView.j | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index f1936bcb3..07389aa84 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -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]))