Skip navigation.
 
mlNSTextView's "Replace All" issues
FROM : Keith Blount
DATE : Tue Jul 04 20:31:42 2006

Hi,

I have an NSTextStorage subclass that is built from
several text storages and handles keeping them in
sync. All works fine. However, it somewhat relies on
NSTextView's delegate method,
-textView:shouldChangeTextInRanges:replacementStrings:,
returning NO when the user is trying to edit a range
that traverses more than one component text storage.
(This is the behaviour I want, as each component is
really a discrete document and I don't want to try to
second-guess the user's intentions in this instance.)

Unfortunately, this screws up the find panel's Replace
All action when trying to replace a word that occurs
in several components. This is because during a
Replace All operation, the text view's delegate method
is only called once, with a union of all the ranges to
be replaced (which can therefore traverse the range of
more than one component even if each individual
replacement range does not) rather than separately for
each range that is to be updated.

Does anybody know if there is any way around this?

Thanks,
Keith

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Related mailsAuthorDate
mlNSTextView's "Replace All" issues Keith Blount Jul 4, 20:31
mlRe: NSTextView's "Replace All" issues Todd Ransom Jul 6, 05:22
mlRe: NSTextView's "Replace All" issues Keith Blount Jul 6, 12:57