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

Re: matcher-list doesn't work with some completers?



On Jan 6,  8:41am, Bart Schaefer wrote:
>
> > ls dir<tab> #works
> > du dir<tab> #nothing
> 
> This is a bug in _du, it's returning a 0 status without ever adding any
> matches, which causes _dispatch in turn to report success to _complete
> which then skips running the matcher-list.
> 
> This in turn is because _du checks for a state transition to handle the
> --time and --time-style options, and that case statement masks the
> return value from _arguments.

Incidentally, the way I approach debugging this stuff (especially when
there's one working and one non-working example as above) is to use
the _complete-debug binding (^X?) to get a temp file xtrace dump of
each of the different cases, and then diff them to look for places
where the flow of control may be going awry.

In the examples above, _complete went on to line 64 after _ls was
finished, but exited at line 63 for _du, which made it obvious that
_du was returning 0 even though it hadn't done anything.

-- 



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