On Thu, Jul 25, 2013, at 10:17 PM, Shane Stanley wrote: > I have a text view that's used for editing code, and I want the user to > be able to double-click within "foo:fie" and have only foo or fie > selected. I overrode mouseDown: and mouseDragged: and thought I was home > free -- but I now realise that's not going to work with completion. > > Changing the system setting to Computer locale isn't an option. I see > Xcode actually does it differently depending on whether the double-click > is inside a string literal or not. I don't see anything obvious -- any > ideas?
Subclass NSTextView and override -selectionRangeForProposedRange:granularity:. That should take care of both mouse- and keyboard-based selection. --Kyle Sluder _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com