Insertion Point moving with NSTextStorage
Insertion Point moving with NSTextStorage
- Subject: Insertion Point moving with NSTextStorage
- From: "Josh Ferguson" <email@hidden>
- Date: Mon, 8 Jul 2002 09:35:37 -0500
- Thread-topic: Insertion Point moving with NSTextStorage
I have a concrete subclass of NSTextStorage, and I'm modifying attributes in order to support syntax coloring. In the overridden replaceCharactersInRange:withString method, I add the new string to my mutable attributed string, call "[self edited:0x0|NSTextStorageEditedCharacters range:aRange changeInLength:length], then I determine, based on the attributes in the string, what range of characters I should re-evaluate attributes on. For example, if I'm in a block comment, I find the beginning and end of the comment, and re-evaluate the space in between. After that, I call [self edited:0x0|NSTextStorageEditedAttributes range:effective changeInLength:0]. When I make that last edit:range:changeInLength call, it moves my insertion point to the end of the range that I pass to it. Of course, I don't want this happening. If I comment this line out, it doesn't move the pointer, but it won't re-color any text past that line. Any ideas what may be going on here behind the scenes? Has anyone else dealt with this problem before?
Josh Ferguson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.