Description
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:
- A shortcut that lets you cycle through branches and change file to match their leaf.
- Same thing as above but in a separate timeline view kinda like git diff view.
- GUI tree view like git graph but you can click on dots to get history
leaf = deepest child node.