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

Re: [PATCH] Proposed change to show-ambiguity context

Bart Schaefer wrote on Sat, May 16, 2015 at 22:39:48 -0700:
> The following patch moves the lookup of the show-ambiguity style from the
> end of _main_complete (where the context is always tagless) into _setup
> where the tags used for list-colors are examined.  This requires another
> local to hang on to the desired color until after compadd has been called
> to calculate the unambiguous prefix.
> As mentioned in the comments added to _setup, really what we want is for
> the most-specific of the list-colors or show-ambiguity context patterns
> to be chosen, because at the time of colorizing the list the ZLS_COLORS
> format used by show-ambiguity is always preferred over file-type colors.

I always wondered list-colors and LS_COLORS were either/or, rather than
overlay list-colors on top of LS_COLORS — that is: have the already-typed
part of the filename in color X, the next-letter-to-be-typed in color Y,
and the remainder of the filename colored according to LS_COLORS.  (where
X and Y are specified by list-colors/show-ambiguity)

> (A possible way to achieve that would be to allow a list-colors value that
> looks like e.g. "ambiguous=1;31" and do away with show-ambiguity.  However,
> I haven't worked out all the ramifications of that.)
> The patch at least allows one to choose to apply show-ambiguity in a more
> restricted set of scopes.
> Thoughts?

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