Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bug related to order of zsh completion options?

Hi zsh-workers,

I found the solution for something which has been plaguing me for about
half a day, and I think it is a bug.

I can sum it up in this file:

----------- file "_brokencompletion" begins ------------

#compdef brokencompletion

# first two versions work
#_arguments '1:a:(( a_b_c\:"aabbcc" a_z\:"aaazzz" ))'
#_arguments '1:a:( a_z a_b_c )'

# this version doesn't
#_arguments '1:a:(( a_z\:"aaazzz" a_b_c\:"aabbcc" ))'

----------- file "_brokencompletion" ends ------------

All of my tests can be repeated with a clean zsh shell:

% zsh -f
  (new shell starts)
% autoload compinit
% fpath=(~/path/containing/_brokencompletion/ $fpath)
% compinit

When I use the one of the first two versions of _arguments in the file
above, I see exactly the completion that I expect to see.

When I use the third version of _arguments, I see the following:

    I type: brokencompletion <tab>
    I get:  brokencompletion a_
                             ^ but my cursor is on the "a"

If I change the order of possible matches in the parenthesis, it fixes
the problem (first version of _arguments line).  Also if I use the
version which does not have descriptions for each command, I get normal

Is this a bug or is this documented somewhere, and I just missed a



Messages sorted by: Reverse Date, Date, Thread, Author