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

Re: Bug#236350: zsh: _prefix completer broken?



On Mar 6, 11:05am, Andrew Pimlott wrote:
} Subject: Re: Bug#236350: zsh: _prefix completer broken?
}
} I noticed a couple other things.  The documentation says that the
} add-space style defaults to true.  This doesn't seem to be the case, as
} if I complete with the cursor on 'f' in "egrefoo", I get just "p" by
} default, and "p " with
} 
}     zstyle ':completion:*' completer _complete _prefix
} 
} in my config.

The add-space style does default to true, and you're seeing exactly what
you should be seeing.  What you (and possibly the documentation) missed
is that the add-space style applies only to the _expand and _prefix
completers, so its default setting makes no difference if you aren't
using one of those.
 
} Also, when the completion on prefix succeeds, as in the "egrefoo"
} example, there is a beep, unlike with a normal successful completion.

This I can reproduce with 4.0.7.  However, I'm having some trouble getting
_any_ of this to work with 4.2.0-pre-3.  Sample output:

schaefer<504> egrefoo
No matches for `external command', `builtin command', `shell function',
`alias', `suffix alias', `reserved word', `job', `parameter', `local
directory', `directory in cdpath', or `corrections'

Here's 4.0.7 for comparison:

schaefer[538] egrefoo
schaefer[538] egrepfoo

(with a feep)

(Aside - in 4.0.7 if I then go on and hit TAB again I get this:

schaefer[538] egrepfoo
                   _
Completing external command

(with the underscore showing the location of the cursor).)

In both 4.2.0-pre-3 and 4.0.7, my completion style looks like this:

zstyle ':completion:*' completer \
  _oldlist _expand _complete _match _ignored _approximate _prefix

However, 4.2.0-pre-3 never gets beyond trying _approximate.  The output
from complete-debug is nearly a megabyte, but it looks as if it gets to
this point in both versions:

: _approximate:75:while; [[ _comp_correct -le comax ]]
: _approximate:111; compstate[pattern_match]='' 
: _approximate:113; return 1
: _main_complete:1; unfunction compadd

And then 4.2.0-pre-3 goes on like this:

: _main_complete:159:for for elif-then; ret=0 
: _main_complete:160:for for elif-then; break 2  <-- doesn't happen in 4.0.7
: _main_complete:169; curcontext=::: 
: _main_complete:170; nm=0 



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