08b04f5df2b9a4747b8f8975785bdcd523d85445

Author
mickk-on-cpp <mickk-on-cpp@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

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

Diff

 1diff --git a/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh
 2index 8ab2979133efda46a4ce1990f4d159da69d603e6..82b968894b32cfeaf88054b8182d0789be42d17f 100644
 3--- a/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh
 4+++ b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh
 5@@ -1,10 +1,10 @@
 6 fancy-ctrl-z () {
 7   if [[ $#BUFFER -eq 0 ]]; then
 8     BUFFER="fg"
 9-    zle accept-line
10+    zle accept-line -w
11   else
12-    zle push-input
13-    zle clear-screen
14+    zle push-input -w
15+    zle clear-screen -w
16   fi
17 }
18 zle -N fancy-ctrl-z