From e0d42962e7bcfcd6a361c4fc610af49ea76d0a6e Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sat, 1 Oct 2016 19:56:35 +0200 Subject: [PATCH] fixed: wrapping issue when dragging last word --- AppKit/CPTextView/CPLayoutManager.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppKit/CPTextView/CPLayoutManager.j b/AppKit/CPTextView/CPLayoutManager.j index 99d403be3..54591368e 100644 --- a/AppKit/CPTextView/CPLayoutManager.j +++ b/AppKit/CPTextView/CPLayoutManager.j @@ -164,7 +164,7 @@ _oncontextmenuhandler = function () { return false; }; if (![self numberOfGlyphs]) return CGRectMake(0, 0, 1, 12); // crude hack to give a cursor in an empty doc. - if (CPMaxRange(aRange) >= [self numberOfGlyphs]) + if (CPMaxRange(aRange) > [self numberOfGlyphs]) aRange = CPMakeRange([self numberOfGlyphs] - 1, 1); var fragments = _objectsInRange(_lineFragments, aRange), @@ -1370,4 +1370,4 @@ var _objectsInRange = function(aList, aRange) "\n\t_attributes="+[_attributes description]; } -@end \ No newline at end of file +@end