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

Re: _approximate doesn't work

Bart Schaefer wrote:
> In any case, now that commands is in _comp_tags again, _path_commands
> is going to be called again, and everything that's in _comp_tags at
> that point eventually ends up duplicated:  at line 2291 "commands" is
> appended again, and so on, until by line 5875 we have everything in
> there three times and "commands" six times.

I can't see any evidence that the value of _comp_tags is actually used
except for being assigned to _lastcomp[tags] right at the end of
_main_complete, which suggests it shouldn't be reset.  _lastcomp[tags]
is only used in _next_tags, where it's used (via _next_tags_not) for
excluding things.  This suggests that its length growing has a
negligible effect.  On the other hand, it might nonetheless benefit from
being a "typeset -Ua" and being manipulated as an array---it's (limited)
mode of use means that won't stop anything working.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070

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