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

Re: _subscript quotes too much



On 09/04/2008, Peter Stephenson <pws@xxxxxxx> wrote:
> On Wed, 9 Apr 2008 12:00:25 +0100
>
> Peter Stephenson <pws@xxxxxxx> wrote:
>
> > As far as _subscript is concerned, it would have to be taught the rules for
>  > which characters can be backslashed, this applied with ${...//.../...}, and
>  > then the -Q flag passed to compadd.  This shouldn't be too hard.
> It wasn't.

Thanks for the explanations and the fix. I read the section in
zshparam you referred to, not sure if i'm more or less confused now
but I think I found two typos.

"This  is  because parameter  expansions  may be surrounded balanced
braces, and subscript flags are introduced by balanced parenthesis."
should probably be 'surrounded by' and 'balanced parentheses'.

>  +  keys=(${${(kP)compstate[parameter]}//(#m)[\$\\\[\]\(\)\[\{\}]/\\$MATCH})
wow :).

> If you can find cases that still don't complete successfully
> it can be tweaked further.

Well,
typeset -A hi
hi=(\" hello)
echo $hi[<tab>

should ideally produce "$hi[\"]" but I don't even know if that's
possible or worth it. :) Or even
hi=(\* hello)
echo $hi[<tab>
would produce $hi[(e)*], but I guess at some point I just have to read
the manual and learn some of the subtler rules instead of depending on
the completion system as these are explained quite clearly there.

-- 
Mikael Magnusson



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