-
Notifications
You must be signed in to change notification settings - Fork 17
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
Non linear undo redo #11
Conversation
f068c3a
to
10b2687
Compare
@TomasMikula I've updated the PR to be much simpler and to read more like a story. I'm not sure if you'd support my decision, but I decided to relocate the UndoManager's boolean bindings inside of the change queue. This leads to more consistency across both implementations of UndoManager. Moreover, a non-linear change queue requires those bindings to be encapsulated inside of it rather than the manager. So, for consistency's sake (and since it doesn't affect much of the other queues), I decided to take that path. Things still to do:
Since this has already taken up so much time (too much to be honest...), I'm limiting the scope of this PR to implement a non-linear system that only uses unlimited non-linear change queues, not the two other variants (fixed-size and zero-size). |
… default implementation via ChangeQueueBase
…lated classes into separate package
c0973f3
to
4ccbfef
Compare
…raph; implementations implement corresponding one.
6c58441
to
e2fc220
Compare
…aming scheme to make more sense at first glance
e2fc220
to
a6efd59
Compare
Ok. I'm pretty sure this will actually work correctly now. |
…als()' in case 2+ queues have added a different-but-equivalent change at some point in their history (whether an undo/redo)
5b36bbc
to
fb89cde
Compare
…oes a change - no need to call `graph.updateChangesWithRedo` AFTER change has been applied since changes only affect which undo/redo is the next valid one. So, call is made within `next/prev` methods
…sibly empty undos/redos list
See #12 since commits were added to the master branch since this PR |
Rather than trying to store all changes in the graph and using the queues as proxy (my approach in #10), I decided to store the changes in the queues and use the graph to store the edges and the queues themselves. This way, the queues feel more queue-like and all three types of queues can be used in the same non-linear undo graph: an unlimited, a fixed-size, and a zero-size queue.