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

Re: 'compadd -P' matches $PREFIX greedily



Daniel Shahaf wrote:
> The following completion function:
>
> % compdef 'compadd -P p_____ papa mama nana aaaa' f
> % f pa<TAB>   → p_____aaaa

Out of interest, was there a real prefix where you came across this.
I was trying to think of more realistic prefixes to see how this
might affect them:

% compdef 'compadd -P file:// /papa //mama /nana aaaa filter' f

before: f fil<tab> → file://
after : f fil<tab> → file://filter

That now seems a bit too aggressive.

How about allowing the longest common prefix to be equal to either
the -P prefix or equal to $PREFIX.

Oliver



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