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

Question regarding Undo History with Slate-Auto-Replace #9

Closed
Nantris opened this issue Dec 5, 2017 · 2 comments
Closed

Question regarding Undo History with Slate-Auto-Replace #9

Nantris opened this issue Dec 5, 2017 · 2 comments

Comments

@Nantris
Copy link
Contributor

Nantris commented Dec 5, 2017

It seems that Slate-Auto-Replace removes each capture group in a separate operation, which means if a user tries to undo it, they actually have to undo each operation one at a time. Is there a reasonably easy way to undo all the changes with a single undo?

Thanks for a millionth time Ian.

@cameracker
Copy link

@slapbox there should be a change.setOperationsFlag('merge', true) operation you can use to get those changes applied to the same undo operations list on the top of the undo stack

@Nantris
Copy link
Contributor Author

Nantris commented Oct 22, 2018

For anyone looking, the method would now be to wrap your changes inside of:

change.withoutNormalizing(() => {
  //  Your changes
})

@Nantris Nantris closed this as completed Oct 22, 2018
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