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

Re: Separate cdpath elements in path-directories completion

On 21 Feb, Sebastian Stark wrote:
> I think a tag should be a) unique and b) easily addressable via zstyle.

The index achieves that and will work fine for anyone who doesn't
regularly make dynamic changes to their $cdpath. To use your example,
I prefer path-directories-1 to path-directories---git but am open to
alternatives if someone feels strongly. For now, I'll apply your patch,
albeit tweaked to address the point Bart made:

Bart wrote:
> Strictly speaking unless $elem is always a full path, the argument to
> -W should be enclosed in parens like:

> alt+=( "path-directories-$elem:directories in $elem:_path_files -W '($elem)' -/" )

I'm getting files from root mixed in if I use _path_files -W '( .. )'
Is that intentional or a bug? While the documentation states that it can
be an array, full path or paren-enclosed list, it can be a non-array
variable or reference to an array element. That works for things like ..
appearing in $CDPATH so is what I've used.

Thanks Sebastian for updating and contributing the patch.


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