-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Transform the undo/redo stacks against non-user initiated changes #413
Conversation
This is an excellent Pull Request. I've actually tried to add this myself in the past but didn't get a chance to nail down all the potential off by one errors. Just a couple of nit picks in the comments but otherwise looks great for merger. |
@@ -33,7 +33,10 @@ class UndoManager | |||
) | |||
@quill.on(@quill.constructor.events.TEXT_CHANGE, (delta, origin) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename origin
to source
? That's the more common name in other parts of the codebase.
Nits addressed. |
Is there a setting to configure undo to be global or per user? |
Fair point @benbro. I'll make it configurable. |
Updated to make this new behavior configurable via a |
Thank you for the userOnly option. |
Since the default is userOnly: false can we change the tests back to what they were and just modify this in the new test? |
Test updated. |
Great thanks! |
Transform the undo/redo stacks against non-user initiated changes
This allows one to mark changes that should be "undoable" by specifying source = 'user', which is useful for a collaborative editing environment in which each client maintains their own undo / redo stack (instead of sharing a global one).