Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _describe bug?
- X-seq: zsh-workers 33207
- From: Vasiliy Ivanov <beelzebubbie.logs@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: _describe bug?
- Date: Sat, 20 Sep 2014 15:21:08 +0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=svpYyqbO+Ty9WDcRacS08hVoTyYGqogCXSvDXjYPtiY=; b=VUtNnwfY8ocHqwPD4Wpp0qccLsTImxiYWvcTFupCAeRPZJJ4VvYo3kAPANuWrWu/Nz 7S6cSYF0tLiitchqAVffXJTts3pjD7SHk8cndWMzUSFquIgamJfqSGwmKEgl5r8+iivj 2tEk+eVilcf94D0h2w4JDghVrIMa98Cv1MqBj/rCz2j4D0DhxoYzI7InbjunjTApqyK4 +GTpAZBBT3CZ25z4D23oAszCEOenFGlRfdhiUgHrfTaj5B09Qg0qk0wVKgB5zcLyGtkj t0VM/JB6w8dusBJK+B8AliFKqPEJNP8e8OQYPDvlCb1OLGMWYgtXV+0MWEfJebPwOpaW RJ2A==
- In-reply-to: <140919191739.ZM28128@torch.brasslantern.com>
- 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: <541C3ECB.80108@gmail.com> <140919191739.ZM28128@torch.brasslantern.com>
Thanks, I had to work out this myself :)
On 09/20/14 08:17, Bart Schaefer wrote:
> On Sep 19, 8:33pm, Vasiliy Ivanov wrote:
> }
> } Recently I noticed completion bug in _describe - if one provided name2
> } parameter (which made name2 array behave as completion list and name1
> } - as label:description list, according to zshcompsys), then completion
> } is offered only for (alphabetically?) first completion element:
> }
> } #compdef testcmd
> } local -a lbl compl
> } lbl=(BBC BB BA AB AA)
> } compl=(bbc bb ba ab aa)
> } _describe 'whatever' lbl compl
> }
> } $ testcmd a<tab>
> } <nothing>
>
> Puzzling how this one went unnoticed for so long. The non-matching
> descriptions were being discarded but the list of matching completions
> was not being updated to correspond, so the arrays of descriptions and
> completions were of different lengths and confusion resulted.
>
>
> diff --git a/Completion/Base/Utility/_describe b/Completion/Base/Utility/_describe
> index f899b0a..1a9f52f 100644
> --- a/Completion/Base/Utility/_describe
> +++ b/Completion/Base/Utility/_describe
> @@ -96,7 +96,7 @@ while _tags; do
> fi
>
> if [[ -n $_mats ]]; then
> - compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs - \
> + compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs -O $_mats - \
> "${(@)${(@M)${(@P)_mats}##([^:\\]|\\?)##}//\\(#b)(?)/$match[1]}"
> else
> compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs - \
>
--
Regards,
Vasiliy Ivanov <beelzebubbie.logs@xxxxxxxxx>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author