Re: NSTextView and undo problems
Re: NSTextView and undo problems
- Subject: Re: NSTextView and undo problems
- From: Timothy Ritchey <email@hidden>
- Date: Sun, 9 Feb 2003 14:55:52 -0500
Is
- (BOOL)textView:(NSTextView *)aTextView
shouldChangeTextInRange:(NSRange)affectedCharRange
replacementString:(NSString *)replacementString
getting called on the delegate during an undo?
On Sunday, February 9, 2003, at 01:49 PM, Koen van der Drift wrote:
Hi,
I am really having a hard time figuring out how to fix this, hopefully
someone on the list can help me.
As I wrote here before, I have an NSTextView, where I would like to
have an
'space' after each 10th character. So each time after the user
adds/removes
characters, I need to update the string. I also use temporary
attributes
for syntax coloring.
Basically, there are 2 changes in the string, first by typing, and then
programatically by setting the spaces in the correct position. What I
do is
update the spaces and attrbutes when the delegate gets the
textDidChange
message.
This all works fine, for one thing. textDidChange is *not* called
after an
undo. Undo of the text is done by the NSTextView, but the updating of
spaces never gets called.
My editor seems similar (although less complicated) to the PB editor's
auto
indentation. Here are also characters (and attributes for syntax
coloring)
added (tabs or spaces) without the user actually typing them. And undo
works just fine - so it is possible! :)
I searched the list- and usenet-archives, but didn't find a solution
for
this, except that others have come across this too and this is indeed a
problem.
Has anyone a solution for this?
thanks,
- Koen.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.