NSTextStorage insertion point
NSTextStorage insertion point
- Subject: NSTextStorage insertion point
- From: Ben <email@hidden>
- Date: Tue, 23 Mar 2010 20:04:23 +0000
Hi list.
I've got an NSTextView subclass which implements the NSTextStorage delegate method -textStorageWillProcessEditing:. In that method I do syntax highlighting and also replace certain substrings with text attachments (a bit like Xcode's autocomplete placeholders).
The problem is that the insertion point is always moved to the end of the text view each time this method is invoked. It seems to happen whenever I modify the attributes of the text, not when I modify the text contents.
Storing the insertion point and restoring it at the end of -textStorageWillProcessEditing or in -textStorageDidProcessEditing still result in the insertion point being moved to the end sometime later. There are other threads online with this problem, but they are old and have no solutions.
Does anyone have any suggestions on how to avoid or work around this problem?
- Ben_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden