diff --git a/Source/NSLayoutManager.m b/Source/NSLayoutManager.m index b6cf93a02..58dc85d4a 100644 --- a/Source/NSLayoutManager.m +++ b/Source/NSLayoutManager.m @@ -133,6 +133,8 @@ changeInLength: (int)lengthChange invalidatedRange: (NSRange)invalidatedRange { + NSLog(@"NSLayoutManager was just notified that a change in the text +storage occured."); } // diff --git a/Source/NSTextStorage.m b/Source/NSTextStorage.m index f0a9798af..f79295f2c 100644 --- a/Source/NSTextStorage.m +++ b/Source/NSTextStorage.m @@ -80,6 +80,18 @@ static Class concrete; return nil; } +- (void) replaceCharactersInRange: (NSRange)aRange + withAttributedString: (NSAttributedString *)attributedString +{ + [super replaceCharactersInRange:aRange + withAttributedString:attributedString]; + + [self edited:NSTextStorageEditedCharacters | NSTextStorageEditedAttributes + range:aRange +changeInLength:aRange.length]; +} + + /* * Managing NSLayoutManagers */ @@ -175,12 +187,15 @@ static Class concrete; NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; + NSLog(@"processEditing called in NSTextStorage."); + [nc postNotificationName: NSTextStorageWillProcessEditingNotification object: self]; r = editedRange; r.length += editedDelta; - [self fixAttributesInRange: r]; +// FIXME, Michael: yeah, this is needed. +// [self fixAttributesInRange: r]; [nc postNotificationName: NSTextStorageDidProcessEditingNotification object: self];