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

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



On 6 January 2011 18:24, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> 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.

Thanks for the fix and the tip, I see also that I was probably the one
to break _du since I added those options, but I had no idea the return
value was even used by the completion system.

I guess I'll have a go at fixing _mkdir then...

-- 
Mikael Magnusson



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