Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: 'compadd -P' matches $PREFIX greedily
- X-seq: zsh-workers 39378
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: 'compadd -P' matches $PREFIX greedily
- Date: Sun, 18 Sep 2016 03:28:07 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1474162087; bh=YjQXqepiyJa76/SlZ3kXxYcPslNosXYZQ2W1gGlah1E=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=QtSmS/g2jDolEJOM7bLwJtJUHXwyDSKxu6Uiac2xN7zWk34YXh0sdDlfdT9+5a4V49mSq0u24vRob1WVeSt/iTmU0ZQ0zsuanrOZznl/Johd/H4JHDMLdSmRLPbjG/BDiILPtup2rPdeT2WPuCi0n/lxYeoLZSWWEML/2TpwoBMn37oxy4amup9u5hdCrQqQa2W2kC5zT7kHD2ENZb5r6WE/ejk/Uone7/KQI4QZDv/QMrlP81Jf3hU+KkszdKNKLYQopsCnJzqUQOyZR3cqveYimPc3TS6HjVwdC/SU7fYafl/9OrbNv8S5EV0TOjC3TXGgVwnw0RowZkpWVsCcHA==
- In-reply-to: <20160917063258.GA26826@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20160917063258.GA26826@fujitsu.shahaf.local2>
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