-
-
Notifications
You must be signed in to change notification settings - Fork 310
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 in the editor #636
Comments
Note that supporting undo also needs to handle abbreviation expansions. And the logic for how much work is undone is complex. I've never paid a lot of attention to how undo works in Vim but it clearly depends on transitions between insert and command mode to delineate how much work is undone. What does that mean for the Emacs editing mode? Also, if undo is supported that implies "redo" should be supported. Too, how much undo/redo state should be supported? At the end of the day I am skeptical that this feature is sufficiently useful as to be justified. Even though I use it regularly in Vim. It seems to me that making it easier to drop into a real editor for non-trivial command edits is preferable. Something like the following that I now rely on in my ~/.elvish/rc.elv:
|
State mutations in the editor "widgets" are already guarded by mutexes, so a natural thing to do is to define each critical section as a unit of undo/redo. |
Also, since code that mutates widget states already needs to be littered with However, this history only operates on the widget level. It still needs some thoughts to connect all the states together into a global state. Conceptually it's easy, but how to implement this cleanly in Go can be an interesting exercise. |
Support undo in the editor.
The text was updated successfully, but these errors were encountered: