Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working correctly with NSTextView #10

Open
tempelmann opened this issue Jan 26, 2022 · 1 comment
Open

Not working correctly with NSTextView #10

tempelmann opened this issue Jan 26, 2022 · 1 comment

Comments

@tempelmann
Copy link

I cannot get coalescing to work with NSTextViews. When I type into such a view, each keystroke gets added as a separate undoable action, instead of them all being grouped into one. I set up the undoer as it's shown in the text code (inside my NSDocument's init):

GCUndoManager *undoer = [GCUndoManager new];
[undoer enableUndoTaskCoalescing];
[undoer setCoalescingKind:kGCCoalesceAllMatchingTasks];
[self setUndoManager:(id)undoer];
[self setHasUndoManager:YES];

And I can confirm that this class' methods get invoked when I type into an NSTextView. If I trace the same calls in a NSUndoManager subclass, I see that registerUndoWithTarget:selector:object: gets invoked only once there, at the first typed character, whereas the same method gets invoked at every keystroke with GCUndoManager. I can't figure out why.

@seanm
Copy link
Owner

seanm commented Jan 28, 2022

I'm afraid I haven't looked at this code in years...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants