I have an open pr with the maintainer of the
edit crate to add this functionality but I wanted to see if there are any objections. The idea is to let users bail out of a changelist from
record by using whatever the “explicitly exit without saving” option is for their editor. Due to the way
edit works right now, using
:q! in vim or exiting nano without saving will still execute the command with the contents of the buffer.
The outliers are going to be graphical editors, since they don’t have such an option, but they don’t work with pijul right now anyway (I think because of
edit). The dichotomy might make it necessary to do this as a config option in the long run, but there are probably other things down the road that would necessitate something like
editor = terminal or
editor = graphical as a config option.
I’d rather have the user save the empty buffer than relying on timestamp precision (which you have to do to make your suggestion work). Selecting and deleting everything is supported by all editors alike.
emacs would also force you to “fake edit” the buffer before being willing to save it. So, this is not a graphical editor kind of issue…
According to your post, I counted an editor that can run on the terminal as a non-graphical editor. In that sense
emacs is as (non-)graphical as
vim. While it can run in a graphical environment, as well, it does not behave any differently from its terminal mode.