Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature request: readline's completion-prefix-display-length option
- X-seq: zsh-workers 38520
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Hong Xu <hong@xxxxxxxxxx>
- Subject: Re: Feature request: readline's completion-prefix-display-length option
- Date: Thu, 19 May 2016 21:14:28 +0000
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- In-reply-to: <CAH+w=7aYcxp73F2koe1nVBRMR8jwJ5eYLAyMi2_35FEX9=dJXw@mail.gmail.com>
- 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: <5738124C.7020705@topbug.net> <CAH+w=7aYcxp73F2koe1nVBRMR8jwJ5eYLAyMi2_35FEX9=dJXw@mail.gmail.com>
Bart Schaefer wrote on Sun, May 15, 2016 at 04:50:50 -0700:
> On Sat, May 14, 2016 at 11:08 PM, Hong Xu <hong@xxxxxxxxxx> wrote:
> >
> > I believe that readline's completion-prefix-display-length is a great
> > option to have for zle. This option enables the common part of long
> > completions to be represented by ellipsis, so the options in the
> > completion list would not be too long in many cases.
>
> There might be a deviously clever way to do this with the list-colors
> style, similar to the way that show-ambiguity is implemented.
Deviously clever solutions aside, isn't this exactly what the -d option
to compadd is for? I imagine prior to calling compadd, the following
preprocessing could be invoked:
if -d not passed:
argument_to_-d = argument_to_-a
for each element of argument_to_-d:
if this element starts with ${PREFIX}
replace the first ${#PREFIX} characters of this element with an ellipsis
However, I'm not sure where this preprocessing should be invoked from.
CHeers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author