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

Re: completing second argument of cd



> On Jul 22,  4:59pm, Zoltan Hidvegi wrote:
> } Subject: Re: completing second argument of cd
> }
> } Have a look at Misc/compctl-examples and Functions/cdmatch2.
> 
> These examples would be a lot more helpful if they included some comments
> explaining which of zsh's baroque parameter manipulation features they are
> (ab)using, and why.  It's pretty obvious that Peter's function and Zoltan's
> are both doing the same basic thing; but I have NO idea what reply[(r)]
> in Zoltan's version means, since according to the documentation the (r)
> should be followed by a pattern.

There is a pattern, don't you see that :-) ?  There is an empty pattern.

The

[[ ${#reply[(r),-1]} != 0 ]] && reply[(r)]="''"

line just replaces an empty array element with a '' since zle_tricky does
not properly quotes empty strings.  Unfortunately replacing the empty sring
to '' in quotename() does not help since it messes up completion if there
is an empty string in the list.

Zoltan



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