From 4f2a1810f2fa1d74008e03a09d66eaff3e5edc9e Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 29 Sep 2016 09:50:09 +0000 Subject: [PATCH] 39495: add-zle-hook-widget: Add end-of-options guard to hook invocation. Currently, the only special widget that takes arguments is zle-keymap-select. --- ChangeLog | 3 +++ Doc/Zsh/contrib.yo | 2 +- Functions/Misc/add-zle-hook-widget | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9df255631..b1b000025 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-09-30 Daniel Shahaf + * 39495: Doc/Zsh/contrib.yo, Functions/Misc/add-zle-hook-widget: + add-zle-hook-widget: Add end-of-options guard to hook invocation. + * 39480: Completion/Debian/Command/_bug: _reportbug: Complete absolute filenames, too. diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 63df292ac..189a084ba 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -346,7 +346,7 @@ as the var(hook) argument. var(widgetname) is the name of a ZLE widget. If no options are given this is added to the array of widgets to be invoked in the given hook context. Note that the hooks are called as widgets, that is, with -example(tt(zle )var(widgetname)tt( -Nw "$@")) +example(tt(zle )var(widgetname)tt( -Nw -- "$@")) vindex(WIDGET, in hooks) Note that this means that the `tt(WIDGET)' special parameter tracks the diff --git a/Functions/Misc/add-zle-hook-widget b/Functions/Misc/add-zle-hook-widget index 572de2561..d8a3950fb 100644 --- a/Functions/Misc/add-zle-hook-widget +++ b/Functions/Misc/add-zle-hook-widget @@ -47,9 +47,9 @@ function azhw:${^hooktypes} { for hook in "${(@)${(@on)hook_widgets[@]}#<->:}"; do if [[ "$hook" = user:* ]]; then # Preserve $WIDGET within the renamed widget - zle "$hook" -N "$@" + zle "$hook" -N -- "$@" else - zle "$hook" -Nw "$@" + zle "$hook" -Nw -- "$@" fi || return done return 0