Thanks for the reply. Yeah, going the custom Text View route is one possibility. I kind of toyed around with that as well, but think I should explore the limits of NSTextView a bit further before going full custom.
Post
Replies
Boosts
Views
Activity
My follow up question would be, where to trigger updates to the NSTextView's drawBackground? Do it in textViewDidChange:notification? or something equivalent to layoutManager:didCompleteLayoutFor:atEnd?
Thanks for the comment. Seems like my notification for replies didn't come.
Doing custom drawing in NSTextView's drawBackground(in:) seems like an interesting workaround. Maybe we can use textViewportLayoutController.viewportRange to find the visible ranges? Or do you mean that call is expensive? Haven't done any tests yet, but if drawBackground(in:) gets called after layout, then it might not be, if the testViewportLayoutController does some caching?
Thanks. Forgot that NSTextContentStorage is a concrete subclass of NSTextContentManager. It will be nice if they have it mirror the NSTextView API though. Cheers!