From c808d2187a7331dff4d493a945482d718e63bc7a Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 26 Oct 2015 08:20:28 +0000 Subject: [PATCH] wrapping: Don't add '--' when invoking widgets. It's the widget's caller's responsibility, not ours, to add '--' where due. If we do it, two instances of '--' might result. (I haven't been able to provoke this problem.) If this commit causes problems, the cause would be widget-callers that don't pass '--' although they should. --- 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 e81f1e8..1d63dbf 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -205,16 +205,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.