How to make NSTextView balance delimiters with a double-click?
问题 It's common to have a text editor for code or other structured content that balances delimiters of some sort; when you double click on a { it selects to the matching }, or similarly for ( ) pairs, [ ] pairs, etc. How can I implement this behavior in NSTextView in Cocoa/Obj-C? (I will be posting an answer momentarily, since I found nothing on SO about this and spent today implementing a solution. Better answers are welcome.) ADDENDUM: This is not the same as this question, which is about