From 282c7134e8acdf241397c207300a65ad9be12e16 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 17 Jan 2016 19:35:07 +0000 Subject: [PATCH] Revert "wrapping: Don't add '--' when invoking widgets." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 c808d2187a7331dff4d493a945482d718e63bc7a. --- zsh-syntax-highlighting.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 3e243d2..905672f 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -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.