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

Re: Bug: _oldlist and automatic coloring of matched



On Fri, Apr 23, 2010 at 3:28 PM, Julius Plenz <julius@xxxxxxxxx> wrote:
>
>    autoload -U compinit && compinit
>    zmodload -i zsh/complist
>    zstyle ':completion:*' completer _oldlist _complete
>    zstyle ':completion:*' menu select select=long-list
>
> If you hit Tab the first time, the listing of filenames is not
> colored. But once you hit Tab again (and the _oldlist completer comes
> into play) suddenly some matches are colored.

This is actually coming from _main_complete, here:

if [[ "$compstate[old_list]" = keep ]]; then
  ZLS_COLORS="$_saved_colors"
elif (( $#_comp_colors )); then
  ZLS_COLORS="${(j.:.)_comp_colors}"
else
  unset ZLS_COLORS
fi

I guess there should be a second test that $_saved_colors is non-empty
before assigning it to ZLS_COLORS ... but I'm not sure that's correct
either, because we don't know at this point *why* $_saved_colors is
empty, i.e., whether the value when saved was empty or unset.



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