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

Re: PATCH: Re: completion after ../



In article <200001240910.KAA02702@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
  Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> writes:

> Or maybe we write a completer (a real, top-level completer) that
> registers a post-completion function which checks if there are only
> alternate matches (or only one alternate match) and no normal one and, 
> if this is the case, makes a list be shown instead of the match(es) be 
> used. That would be quite easy (set compstate[insert]='',
> compstate[list]='list force'), , but I'm not sure if this is enough or 
> the right thing at all.

I tried this and I found it's enough for me.  Of course, I agree that
it's quite inconsistent behaviour and it shouldn't be default.

So I want to insert following fragment at last in _main_complete.

if zstyle -b ":completion:..." &&
   [[ $compstate[old_list] != shown &&
      $compstate[nmatches] = 0 &&
      $compstate[alternate_nmatches] = 1 ]]; then
  compstate[insert]=''
  compstate[list]='list force'
fi

What's a proper context and a style?  I couldn't find them.
-- 
Tanaka Akira



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