Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] _widgets: Complete zle-* widgets too.
- X-seq: zsh-workers 38974
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] _widgets: Complete zle-* widgets too.
- Date: Sat, 30 Jul 2016 07:40:08 -0700
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wfhXe4gkGE0C19p/GqmBeyX6quCz8pqzz6WEAmJdm0c=; b=0SNm4nkZK0qSyulv2AW78md3JyzftmNEsIkxcl+XNOs5a9od7gVccBr01JkyfXGTeV fIiMKMM3T5jXQ868ERoN/qQjmV2evpAvwSgzuCoX+cBZxyGZ2dPoi/UOopz3MCZ0UAWI LwQz+KG7Tgxabg9YFQI/jGrX8ylkvG7JBJRS8r/HqmNnoZBljvkYBe6Smev3J21Djk2u 8nUJjiYZkZW3RZ+Y7m+7+bhmwu5OFvOIoQRQnydB73T2QmjUWctEu2cMhF/IdbKxwOlx x3jU2lyJ0oVSHza78NywpzT2udgjPBb2FPbFFmcHcFdfKiVJI52ogBBYQpk7SY4mV46c FB9Q==
- In-reply-to: <1469884317-3192-1-git-send-email-danielsh@tarsus.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1469884317-3192-1-git-send-email-danielsh@tarsus.local2>
I don't think this is right. Those names should be completed only if they
have already been created with "zle -N", and it is not appropriate to
autoload add-zle-hook-widget in the generic widgets completion function.
On Jul 30, 2016 8:13 AM, "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> ---
> Completion/Zsh/Type/_widgets | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/Completion/Zsh/Type/_widgets b/Completion/Zsh/Type/_widgets
> index fdab281..0e7f491 100644
> --- a/Completion/Zsh/Type/_widgets
> +++ b/Completion/Zsh/Type/_widgets
> @@ -2,8 +2,14 @@
>
> local expl pattern
>
> +local -a fake
> +autoload -U add-zle-hook-widget
> +add-zle-hook-widget -h >&/dev/null # sets the zstyle
> +zstyle -g fake zle-hook types
> +fake=( zle-${^fake} )
> +
> pattern=( -g \* )
> zparseopts -D -K -E g:=pattern
>
> _description widgets expl widget
> -compadd "$@" "$expl[@]" -M 'r:|-=* r:|=*' -
> "${(@k)widgets[(R)${pattern[2]}]}"
> +compadd "$@" "$expl[@]" -M 'r:|-=* r:|=*' -
> "${(@k)widgets[(R)${pattern[2]}]}" "${(@M)fake:#${~pattern[2]}}"
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author