Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Separate cdpath elements in path-directories completion
- X-seq: zsh-workers 51476
- From: Oliver Kiddle <opk@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Separate cdpath elements in path-directories completion
- Date: Fri, 24 Feb 2023 13:57:55 +0100
- Archived-at: <https://zsh.org/workers/51476>
- In-reply-to: <20230221221247.aacrywwb7fmnzmew@singold.localdomain>
- List-id: <zsh-workers.zsh.org>
- References: <20230218211046.vj3p4k7y6uraytpo@singold.localdomain> <CAH+w=7bhjyXVgMb7esyg-1n0SbBAZogUrCVg34wFB64z3aUimg@mail.gmail.com> <20230219100217.f2mcniygwgbtxvwf@singold.localdomain> <80615-1676825482.916080@qR5n.Nmed.T67B> <20230221221247.aacrywwb7fmnzmew@singold.localdomain>
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.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author