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] Unexpected change received? #7

Closed
benedictleejh opened this issue Nov 5, 2015 · 2 comments
Closed

[Question] Unexpected change received? #7

benedictleejh opened this issue Nov 5, 2015 · 2 comments

Comments

@benedictleejh
Copy link

This is probably me not understanding the changes in 1.2, but when I undo an action, then redo it, and then try to take a new action, the undo manager crashes with an Unexpected change received.

Am I supposed to send redone changes to the change stream as well?

@TomasMikula
Copy link
Member

Yes. Doesn't that make the code easier, not having to care whether to push a change to the UndoManager or not? Just uniformly push all the changes.

Btw, that was the assumption in pre-1.2 too, that UndoManager would receive all the changes. In pre-1.2, it just ignored any changes received while doing undo/redo. In 1.2, it checks whether the incoming change is exactly the same (as per equals) as the one being re-done.

@benedictleejh
Copy link
Author

That does make it simpler. I was manually handling this before, but this is nice since I don't have to think about it anymore.

I do, however, suggest noting it somewhere, because I suspect when people think about undo, one of the first questions that come up is how do I not cause an infinite loop of undone changes causing new undoable changes (at least, it was what I was thinking about).

I'll close the issue too, since the question's been answered.

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