When I invoke this widget with ^x^e
and then exit the visual editor (vim), the current command is aborted with an error and the command contents is put on the next command line to be executed.
What I expect is that the command content should be put back on the current command line, just like in bash. And I suspect the error is because of the non-zero editor exit status.
I even start zsh fresh like:
zsh -f
autoload -U edit-command-line && zle -N edit-command-line
bindkey '^x^e' edit-command-line
But still got the same problem.
This seems intended. He said that at the time on the zsh mailing list:
The error might be triggered by using
send-break
at the end of the function these days.Indeed, it could be extended like this patch for the
edit-command-line
file:(The file might be found by
% echo ${^fpath}/edit-command-line(N)
)With this patch, it puts back the edited contents on the current command line then executes.