Re: Advanced NSTextView use

2009-02-04 Thread Ross Carter
I don't know know if there's a better way, but I call my selection- fixing code in -selectionRangeForProposedRange:granularity:, and also in the following NSTextView overrides if the selected range length is 0 (if it's not zero, presumably it's already been fixed by - selectionRangeForPropose

Re: Advanced NSTextView use

2009-02-04 Thread Chris Idou
That didn't seem to help. I tried overriding selectedRanges, and that makes you delete the whole range when you are clicked in it (good), but nothing seems to help the case of trying to simply backspace from the end of the range. In this case the selected range is not relevant because you are no

Re: Advanced NSTextView use

2009-02-03 Thread Martin Wierschin
On Feb 3, 2009, at 5:24 PM, Chris Idou wrote: So I want it that if you try and delete any character that is part of a token, it deletes the entire token. So I'm overriding rangeForUserTextChange to return a different range if the current range includes any part of a token. This seems to w

Advanced NSTextView use

2009-02-03 Thread Chris Idou
I'm trying to use NSTextView so that it has tokens in the text (kind of like NSTokenField). So I want it that if you try and delete any character that is part of a token, it deletes the entire token. So I'm overriding rangeForUserTextChange to return a different range if the current range incl