diff --git a/AppKit/CPTextView/CPLayoutManager.j b/AppKit/CPTextView/CPLayoutManager.j index 7ab310281..7b88a46c8 100644 --- a/AppKit/CPTextView/CPLayoutManager.j +++ b/AppKit/CPTextView/CPLayoutManager.j @@ -1020,6 +1020,7 @@ var _objectsInRange = function(aList, aRange) CPArray _glyphsFrames @accessors(getter=glyphFrames); BOOL _isInvalid; + BOOL _isLast; CGRect _fragmentRect; CGRect _usedRect; CGPoint _location; diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index af239ab09..78398068f 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -518,7 +518,6 @@ var kDelegateRespondsTo_textShouldBeginEditing if (!isAttributed) aString = [[CPAttributedString alloc] initWithString:aString attributes:_typingAttributes]; - var undoManager = [[self window] undoManager]; [undoManager setActionName:@"Replace/insert text"]; @@ -2151,7 +2150,6 @@ var _CPCopyPlaceholder = '-'; return false; // prevent the default behaviour } - var currentFirstResponder = [[CPApp mainWindow] firstResponder]; if (![currentFirstResponder respondsToSelector:@selector(_activateNativeInputElement:)]) diff --git a/AppKit/CPTextView/CPTypesetter.j b/AppKit/CPTextView/CPTypesetter.j index 9633d76d1..d115afd24 100644 --- a/AppKit/CPTextView/CPTypesetter.j +++ b/AppKit/CPTextView/CPTypesetter.j @@ -173,7 +173,11 @@ var CPSystemTypesetterFactory; containerSize = aContainer._size; [_layoutManager setTextContainer:_currentTextContainer forGlyphRange:lineRange]; // creates a new lineFragment - _lineFragments.push([_layoutManager._lineFragments lastObject]); + + var fragment = [_layoutManager._lineFragments lastObject]; + fragment._isLast = !sameLine; + _lineFragments.push(fragment); + [_layoutManager setLineFragmentRect:rect forGlyphRange:lineRange usedRect:rect]; switch ([_currentParagraph alignment])