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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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 theNSTextViews.