Revert "wrapping: Don't add '--' when invoking widgets."

The '--' guard was correct; it was there to guard against arguments belonging
to the syntax «zle widget [ -n num ] [ -Nw ] [ -K keymap ] args».

For example, this affected using <backward-kill-word> over
    BUFFER="-w "
    CURSOR=3
after
    autoload -Uz select-word-style
    select-word-style default
    zstyle ':zle:backward-kill-word' word-style shell
.

This reverts commit c808d2187a.

(cherry picked from commit 282c7134e8)
This commit is contained in:
Daniel Shahaf 2016-01-17 19:35:07 +00:00
parent 7338c54a25
commit 4ad3d23c6d

View File

@ -208,16 +208,16 @@ _zsh_highlight_bind_widgets()
# User defined widget: override and rebind old one with prefix "orig-".
user:*) eval "zle -N orig-$cur_widget ${widgets[$cur_widget]#*:}; \
_zsh_highlight_widget_$cur_widget() { _zsh_highlight_call_widget orig-$cur_widget \"\$@\" }; \
_zsh_highlight_widget_$cur_widget() { _zsh_highlight_call_widget orig-$cur_widget -- \"\$@\" }; \
zle -N $cur_widget _zsh_highlight_widget_$cur_widget";;
# Completion widget: override and rebind old one with prefix "orig-".
completion:*) eval "zle -C orig-$cur_widget ${${widgets[$cur_widget]#*:}/:/ }; \
_zsh_highlight_widget_$cur_widget() { _zsh_highlight_call_widget orig-$cur_widget \"\$@\" }; \
_zsh_highlight_widget_$cur_widget() { _zsh_highlight_call_widget orig-$cur_widget -- \"\$@\" }; \
zle -N $cur_widget _zsh_highlight_widget_$cur_widget";;
# Builtin widget: override and make it call the builtin ".widget".
builtin) eval "_zsh_highlight_widget_$cur_widget() { _zsh_highlight_call_widget .$cur_widget \"\$@\" }; \
builtin) eval "_zsh_highlight_widget_$cur_widget() { _zsh_highlight_call_widget .$cur_widget -- \"\$@\" }; \
zle -N $cur_widget _zsh_highlight_widget_$cur_widget";;
# Default: unhandled case.