diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index b711947aa..fcf6a8767 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -775,6 +775,9 @@ var kDelegateRespondsTo_textShouldBeginEditing if (_startTrackingLocation === CPNotFound) _startTrackingLocation = [_layoutManager numberOfCharacters]; + if (fraction[0] > 0.5) + _startTrackingLocation++; + [self setSelectionGranularity:granularities[[event clickCount]]]; var setRange = CPMakeRange(_startTrackingLocation, 0); @@ -821,6 +824,9 @@ var kDelegateRespondsTo_textShouldBeginEditing if (index === CPNotFound) index = _scrollingDownward ? CPMaxRange(oldRange) : oldRange.location; + if (fraction[0] > 0.5) + index++; + if (index > oldRange.location) { [self _clearRange:_MakeRangeFromAbs(oldRange.location,index)]; @@ -884,6 +890,9 @@ var kDelegateRespondsTo_textShouldBeginEditing var dindex= [_layoutManager glyphIndexForPoint:point inTextContainer:_textContainer fractionOfDistanceThroughGlyph:fraction], oldStickyLoc = _stickyXLocation; + if (fraction[0] > 0.5) + dindex++; + [self _establishSelection:CPMakeRange(dindex, 0) byExtending:NO]; _stickyXLocation = oldStickyLoc; [self scrollRangeToVisible:CPMakeRange(dindex, 0)] @@ -925,6 +934,9 @@ var kDelegateRespondsTo_textShouldBeginEditing var dindex = [_layoutManager glyphIndexForPoint:point inTextContainer:_textContainer fractionOfDistanceThroughGlyph:fraction], oldStickyLoc = _stickyXLocation; + if (fraction[0] > 0.5) + dindex++; + [self _establishSelection:CPMakeRange(dindex,0) byExtending:NO]; _stickyXLocation = oldStickyLoc; [self scrollRangeToVisible:CPMakeRange(dindex, 0)];