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

Re: Who is sorting my completion results?



"Mikael Magnusson" wrote:
> I'm trying to add reflog completion for git (nevermind what that is if
> you don't know :), they look like foo@{1}, foo@{2}, etc. git reflog
> gives an already sorted list of reflog entries, but when I try my
> completion in the shell, they are re-sorted as foo@{1}, foo@{10},
> foo@{100}, foo@{2}, etc. Who and why is this list resorted by?
> (+grammar).

Sorting or not sorting is done by whether you pass the option "-J group"
or "-V group" to compadd.  In your case it looks like the right thing to
do is to pass the option "-V" (only) to _wanted, which will construct an
appropriate argument list for compadd.
Completion/Zsh/Type/_directory_stack was the simplest example I noticed
of this happening.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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