OK, so this is what I want :
- We have an
NSTextView - Get “current” word (as an
NSRange?), at cursor position (how could this be determined?) - Highlight it (change its attributes)
I’m not sure how to go about this : I mean my main concern is getting current position within NSTextView and getting the word at point (I know some Text plugins support that, but I’m not sure as of the original NSTextView implementation…)
Is there any built-in function for that? Or, if not, any ideas?
UPDATE : Cursor position (SOLVED)
NSInteger insertionPoint = [[[myTextView selectedRanges] objectAtIndex:0] rangeValue].location;
Now, still trying to find a workaround for a specifying the underlying word…
Here’s one way: