No need for a tree. Just do https://github.com/zaboople/klonk/blob/master/TheGURQ.md
Aka
- Undo stack (as per usual)
- Redo stack (as per usual)
But with one special tweak
- Undo puts stuff on the redo stack (as per usual)
- Now I start editing
- So I grab the entire redo stack, and put it onto the undo stack (going to the present before the undos)
- Then I undo all these changes, putting that onto the undo stack (going to the point in time where I am)
- And now I can put my edits onto the undo stack
Thus, it gives us a linear history that looks like
edits => doing edits backwards => new edits
Emacs does that as well.
No need for a tree. Just do https://github.com/zaboople/klonk/blob/master/TheGURQ.md
Aka
But with one special tweak
Thus, it gives us a linear history that looks like
edits => doing edits backwards => new edits
Emacs does that as well.