Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zstyle: "more specific" patterns and *-components
dana wrote on Tue, 28 Apr 2020 19:30 +00:00:
> On 28 Apr 2020, at 14:06, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > I don't immediately see the rationale behind your proposed scoring. The
> > two patterns you mention, «:foo» and «:foo:*», don't seem parallel to
> > each other, since there's no possible context that can be matched by
> > both of them.
>
> Well, the example i gave was :foo: vs :foo:*, not :foo vs :foo:*.
>
Ah, sorry.
My guess for why * is weighted zero is what Mikael said. Note that
«:foo:» is scored as 3 constant strings ("" "foo" ""), so it outscores
«:foo:*» and would do so even if the pattern «*» weren't special cased
compared to other patterns.
> But you're right, anyway. I was too focussed on my issue with the * patterns
> to see the much simpler and more general fix re: the number of components.
> Just looking at it, i think what you're suggesting addresses everything, ty
*nod*
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author