Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion: How to show description for current option?
On 31 Aug, Marlon Richert wrote:
> If I type
>
> % git switch -c^D
>
> then completion shows only
> -c
This can be reproduced with just _arguments -s '-c[desc]'
The code relevant to this is this part of _arguments:
346 if comparguments -O next direct odirect equal; then
347 opts=yes
348 _tags options
349 elif [[ $? -eq 2 ]]; then
350 compadd -Q - "${PREFIX}${SUFFIX}"
351 return 0
The comparguments -O has decided that there are no possible completion
matches which is arguably true because -c is already there and, because
we passed -s to _arguments, it is now trying to complete further options
after -c. It looks like there is special handling for this case that has
only considered actual completion because it is doing a plain compadd
without descriptions.
A similar case would be _arguments -s '-c[desc]' -d
and -dc^D
That prints 'no arguments'
A fix would need to be done within the C code for comparguments -O and
it'd probably be hard to do without breaking it more than fixing it.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author