Skip to content

Not working correctly with NSTextView #10

@tempelmann

Description

@tempelmann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions