zsh-workers
 help / color / mirror / code / Atom feed
* completion display question
@ 2010-02-05 18:50 Greg Klanderman
  2010-02-08  5:24 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Klanderman @ 2010-02-05 18:50 UTC (permalink / raw)
  To: Zsh list


I was wondering if there's some way for completion listings to
indicate the common portion - if there are many similar looking
completions, you want some indication of what characters you can
type next to disambiguate.  I'm imagining maybe some way to
highlight the unmatched portions of the completions - is that
possible?

I really like the removable suffix highlighting, btw!

thanks,
Greg


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: completion display question
  2010-02-05 18:50 completion display question Greg Klanderman
@ 2010-02-08  5:24 ` Bart Schaefer
  2010-02-20 19:16   ` Greg Klanderman
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2010-02-08  5:24 UTC (permalink / raw)
  To: Zsh list

On Feb 5,  1:50pm, Greg Klanderman wrote:
}
} I was wondering if there's some way for completion listings to
} indicate the common portion

It'd be nice if this worked:

zstyle -e ':completion:*:*:*:*' list-colors \
  'reply=("=(#b)(${(q)compstate[unambiguous]})*=0=01;31")'

Unfortunately the list-colors style is evaluated "too early," before
the completion internals have assigned compstate[unambiguous].

So I suggest you start from the following and try tweaking the
(${(q)PREFIX}) part until you get something close enough to what
you want:

zstyle -e ':completion:*:*:*:*' list-colors \
  'reply=("=(#b)(${(q)PREFIX})*=0=01;31")'

E.g. you may want (#b)*(${(q}PREFIX:t})* or something like that, and you
may want different patterns for different contexts.

Replace "01;31" with another color spec if you don't like red.  Also (q)
may not be sufficient to quote the prefix for pattern purposes.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: completion display question
  2010-02-08  5:24 ` Bart Schaefer
@ 2010-02-20 19:16   ` Greg Klanderman
  2010-02-20 21:06     ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Klanderman @ 2010-02-20 19:16 UTC (permalink / raw)
  To: zsh-workers


Finally getting back to this, thanks Bart, very cool!

> zstyle -e ':completion:*:*:*:*' list-colors \
>   'reply=("=(#b)(${(q)PREFIX})*=0=01;31")'

> E.g. you may want (#b)*(${(q}PREFIX:t})* or something like that, and you
> may want different patterns for different contexts.

Is there some way to have it depend on which element of my
matcher-list is in effect?  Gotta go read the manual...

thanks,
Greg


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: completion display question
  2010-02-20 19:16   ` Greg Klanderman
@ 2010-02-20 21:06     ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2010-02-20 21:06 UTC (permalink / raw)
  To: zsh-workers

On Feb 20,  2:16pm, Greg Klanderman wrote:
}
} > zstyle -e ':completion:*:*:*:*' list-colors \
} >   'reply=("=(#b)(${(q)PREFIX})*=0=01;31")'
} 
} Is there some way to have it depend on which element of my
} matcher-list is in effect?

Unfortunately, no, that's another item that's not determined until
much later than the point at which the list-colors style is looked up.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-20 21:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-05 18:50 completion display question Greg Klanderman
2010-02-08  5:24 ` Bart Schaefer
2010-02-20 19:16   ` Greg Klanderman
2010-02-20 21:06     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).