-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Undo/Redo but non-linear #117014
Comments
Duplicate of #20889 |
thanks updated the linked post, however, it seems to have gone stale. |
I'd like propose another shortcut. Undo/Redo shortcuts should work linearly as they do now. Editor should know which branch the user has backtracked from and upon redoing should go back to it. But have additional shortcuts to cycle through branches. So one for up and one for down. Pressing these shortcuts will take you leaf nodes of sibling branches. Summary of shortcuts:
This doesn't require GUI, GUI is nice to have but not required. Visual Explanation Furthermore, it'd be useful for last edited branch to be the most bottom branch. This way when you cycle back you always go in descending order of last modified. |
There is some vagueness in ordering branch by last modified, probably best figured out by testing it |
It'd be insanely useful to be able to go back in code and change things but still be able to come back to older most forward state.
For example, I'm coding something, I try a new approach, realize it does't work. Do bunch of undos. Get back to when code worked. Try a different approach, realize there was a utility function I could have used from previous approach here as well. But it's gone since in linear history, once you go back and make an edit, all forward history gets deleted.
Conceptually it's easy to imagine states as a tree data structure. Every time you make an edit if there is an existing child, then add another, not replace it. So instead of double linked list, it becomes a tree. However, I think what makes it or breaks this feature is the UI.
It's important to not modify undo/redo, but add to it somehow..
Some UI ideas:
leaf = deepest child node.
The text was updated successfully, but these errors were encountered: