--- /tmp/gui/Source/NSTextView.m Tue Oct 30 20:09:07 2001 +++ NSTextView.m Thu Nov 1 11:49:08 2001 @@ -229,6 +229,7 @@ [self setTypingAttributes: [isa defaultTypingAttributes]]; + [self setTextContainerInset: NSMakeSize(0,0)]; [self setBackgroundColor: [NSColor textBackgroundColor]]; [aTextContainer setTextView: self]; @@ -1037,11 +1038,13 @@ _textContainerOrigin.x += usedRect.origin.x; /* First get the pure text container origin */ - _textContainerOrigin.y = NSMaxY (_bounds); - _textContainerOrigin.y -= _textContainerInset.height; - _textContainerOrigin.y -= textContainerSize.height; + //_textContainerOrigin.y = NSMaxY (_bounds); + //_textContainerOrigin.y -= _textContainerInset.height; + //_textContainerOrigin.y -= textContainerSize.height; /* Then move to the used rect origin */ - _textContainerOrigin.y += usedRect.origin.y; + //_textContainerOrigin.y += usedRect.origin.y; + + _textContainerOrigin.y = _textContainerInset.height; } - (NSLayoutManager*) layoutManager @@ -1099,6 +1102,7 @@ color: (NSColor*)color turnedOn: (BOOL)flag { + if (_window == nil) { return; @@ -1537,14 +1541,14 @@ rect = [_layoutManager lineFragmentRectForGlyphAtIndex: glyphIndex effectiveRange: NULL]; - + if ([self selectionAffinity] != NSSelectionAffinityUpstream) { /* Standard case - draw the insertion point just before the associated glyph index */ NSPoint loc = [_layoutManager locationForGlyphAtIndex: glyphIndex]; - rect.origin.x += loc.x; + rect.origin.x += loc.x; } else /* _affinity == NSSelectionAffinityUpstream - non standard */ { @@ -1584,7 +1588,6 @@ } _insertionPointRect = rect; - /* Remember horizontal position of insertion point */ _originalInsertPoint = _insertionPointRect.origin.x; @@ -2116,6 +2119,7 @@ possible) */ startPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil]; + startIndex = [self characterIndexForPoint: startPoint]; if ([_textStorage containsAttachments])