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

Re: Completion of prefix redirections is -command- instead of -redirect-



On Thu, Aug 27, 2015 at 7:14 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Aug 27,  6:54am, Mikael Magnusson wrote:
> }
> } < ; <tab> gives commands (correct)
>
> This is better than 5.0.7, which gives files here.
>
> } foo < ; <tab> gives files (wrong-ish)
>
> Hasn't changed from 5.0.7.
>
> } ; < <tab> gives commands (wrong)
>
> This has changed, 5.0.7 gets it right.
>
> } foo=bar; < <tab> gives commands (wrong, presumably same case as the above)
>
> Hasn't changed since 5.0.7.
>
> } Is there any reason we can't just reset state to 'this is a new
> } command' when we see an unquoted solo semicolon? Or is determining
> } that this is the case in fact the trouble?
>
> My recollection of all of this is that it has to do with completing
> in the middle of for/while/repeat type constructs, where the ";" may
> be followed by "do" after which you have to stay in command position,
> or you may be in shortloops syntax, etc.  But I don't recall (and
> likely never really understood Sven's explanation of) all the details.
>
> The below seems to make it better, the only case that is still wrong
> after this is "foo < ; <tab>".  But I haven't more than minimally
> checked that completing in e.g. "for" loops still works properly.

When I try this patch, I get all my previous cases right except the
one you mentioned, but also
; < : <tab>
completes files instead of commands now (before, it completed commands
both with and without the : there, so not more correct in total).
However,
foo=bar; < : <tab>
does work, so I can't imagine anyone complaining about this particular
case soon.

I'll run with both of the patches applied for a while and see if
anything more pops out.

PS
If anyone can get
for (a b) {<tab>
to complete commands, that would be nice too :). (this never worked)

-- 
Mikael Magnusson



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