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

Re: PATCH: Re: completion after ../



In article <200002180939.KAA30810@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
  Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> writes:

> Or we name it `single-ignored' (yes, there must be a better name) and
> enhace it: if it's set to `show' we use the above. If it's set to
> `menu' we also add the string from the line in the alternate set (as
> usual, with -S '', in it's own group, with a call to _description and
> so on...) and start menu-completion (compstate[insert]=menu).

I tried this.  I inserted the following fragment just before line 83
in _main_complete.

if zstyle -s ":completion:${curcontext}:" single-ignored tmp &&
   [[ $compstate[old_list] != shown &&
      $compstate[nmatches] = 0 &&
      $compstate[alternate_nmatches] = 1 ]]; then
  case "$tmp" in
  show) compstate[insert]='' compstate[list]='list force';;
  menu) compstate[insert]='menu';;
  esac
  tmp=false
  [[ $tmp = menu ]] && tmp=true
else
  tmp=false
fi

if [[ $compstate[nmatches] -gt 1 ]] || $tmp; then
...

But I couldn't find the way to get the string from the alternate set.
So, it completes a word with a following space and the next <TAB>
completes a next word.

How can we get the string?
-- 
Tanaka Akira



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