NSTextView find panel problem with smart quotes

In our app we have smart quote substitution turned on in an NSTextView subclass, and this is causing problems with the find panel. Searches for words with apostrophes don't end up working because of the smart quote substitution. Instructing our users to manually insert smart quotes in the find panel seems like a big ask, and we'd like to just handle this gracefully behind the scenes.


Is there a way to programmatically change what's being searched for in an NSTextView without re-implementing search from the ground up? I know we can access the "find pasteboard" and I can get what's being searched for, but setting a new string value before performTextFindAction is called doesn't seem to affect the current seach. If anyone knows how to deal with this or can point me in the right direction that would be a huge help.


Thanks.

Replies

So you don't want to forbid smart quotes in the NSTextField itself by setting its keyboard to ASCII ?