fancy-ctrl-z: ensure widgets are called with full context (#4838)

This allows other plugins that hook e.g. accept-line to identify the
fancy-ctrl-z widget as the caller and take appropriate steps when
necessary.

See https://github.com/tarruda/zsh-autosuggestions/issues/82#issuecomment-181133379
This commit is contained in:
mickk-on-cpp 2020-02-28 17:27:16 +01:00 committed by GitHub
parent 2b499e1a9e
commit 08b04f5df2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,10 +1,10 @@
fancy-ctrl-z () { fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg" BUFFER="fg"
zle accept-line zle accept-line -w
else else
zle push-input zle push-input -w
zle clear-screen zle clear-screen -w
fi fi
} }
zle -N fancy-ctrl-z zle -N fancy-ctrl-z