Take the 2-minute tour ×

I noticed that if you hook up two NSTextViews to the same NSTextStorage object, you can select across the two and copy/undo/etc. as if they were one. At what level is this all managed? Where should I get the combined selected range from?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Selection is managed in NSLayoutManager. It seems, your two views connected to the same layout manager like on this picture.

If you use more then one layout manager with the text storage, you could get the combined selected range by combining the individual selectedRanges: of all the NSTextViews.

share|improve this answer
add comment

Your Answer


