Text Editor Data Structures: Rethinking Undo
cdacamar.github.io
Text Editor Data Structures: Rethinking Undo
1–10 of 84 posts
Re: Text Editor Data Structures: Rethinking Undo
#2 - Modal editing makes for nice "undo" points, clarifying whether undo should undo "World!" or "!".
- "g-" and "g+" eliminate the "orphaned redo". They walk the entire undo/redo tree rather than just the linear undo/redo.
- Time travel undo/redo is really handy when you want to go to where you were on the wall-clock. ":earlier 15 minutes" takes you to the code as it was 15 minutes ago.Re: Text Editor Data Structures: Rethinking Undo
#3I just skimmed it, but it looks like vim really has undo/redo "solved": - Modal editing makes for nice "undo" points, clarifying whether undo should undo "World!" or "!". - "g-" and "g+" eliminate the "orphaned redo". They walk the entire undo/redo tree rather than just the linear undo/redo. - Time travel undo/redo is really handy when you want to go to where you were on the wall-clock. ":earlier 15 minutes" takes yo…
Re: Text Editor Data Structures: Rethinking Undo
#4I actually used regular Emacs undo for years which lets you get everywhere in the tree with a kind of tree traversal but you won't know where you are. I resisted undo-tree for ages but it's definitely worth it as it stays out of the way until the occasion you might need to use it.
Re: Text Editor Data Structures: Rethinking Undo
#5I just skimmed it, but it looks like vim really has undo/redo "solved": - Modal editing makes for nice "undo" points, clarifying whether undo should undo "World!" or "!". - "g-" and "g+" eliminate the "orphaned redo". They walk the entire undo/redo tree rather than just the linear undo/redo. - Time travel undo/redo is really handy when you want to go to where you were on the wall-clock. ":earlier 15 minutes" takes yo…
Re: Text Editor Data Structures: Rethinking Undo
#6I went down this rabbit hole a while back. I had to really dig[1]: it's been 5 years...
---
Data structures aren't the only interesting rabbit-hole, though.
UI/UX doesn't get nearly as much attention as it deserves. There are really only two that I am aware of: Notepad and Vim. Vim's modal editing results in the user explicitly defining undo/redo points. You can even use the "." key to re-redo! Everything else essentially boils down to a greater or lesser version of Notepad: The user can't predict what state undo will take them to.
Something I have wanted to create for a long time (definitely more than 5 years) is a new modal editor. I don't want yet another vi clone: I want something that is defined from the ground up by user configuration. Maybe one of these days I will get far enough past the ADHD wall to make it happen...
Re: Text Editor Data Structures: Rethinking Undo
#7I just skimmed it, but it looks like vim really has undo/redo "solved": - Modal editing makes for nice "undo" points, clarifying whether undo should undo "World!" or "!". - "g-" and "g+" eliminate the "orphaned redo". They walk the entire undo/redo tree rather than just the linear undo/redo. - Time travel undo/redo is really handy when you want to go to where you were on the wall-clock. ":earlier 15 minutes" takes yo…
I love vim but I actually find undo/redo to be one of the few annoyances of the program, because of the whole linear undo/redo thing. So I guess I need to look into this g+ option…
My favorite thing about vim's flow is that it isn't just limited to undo/redo: you can re-perform your most recent action anywhere using the . key.
Re: Text Editor Data Structures: Rethinking Undo
#8I just skimmed it, but it looks like vim really has undo/redo "solved": - Modal editing makes for nice "undo" points, clarifying whether undo should undo "World!" or "!". - "g-" and "g+" eliminate the "orphaned redo". They walk the entire undo/redo tree rather than just the linear undo/redo. - Time travel undo/redo is really handy when you want to go to where you were on the wall-clock. ":earlier 15 minutes" takes yo…
Don't forget about the Gundo plugin: it lets you navigate your tree of undo history.
Re: Text Editor Data Structures: Rethinking Undo
#9Re: Text Editor Data Structures: Rethinking Undo
#10I just skimmed it, but it looks like vim really has undo/redo "solved": - Modal editing makes for nice "undo" points, clarifying whether undo should undo "World!" or "!". - "g-" and "g+" eliminate the "orphaned redo". They walk the entire undo/redo tree rather than just the linear undo/redo. - Time travel undo/redo is really handy when you want to go to where you were on the wall-clock. ":earlier 15 minutes" takes yo…
TIL. Very cool. tnx