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

Re: zle messes up 'words' variable?



Hi,

2011/4/27 Felipe Contreras <felipe.contreras@xxxxxxxxx>:
> I'm trying the following:
> ---
> set_vars ()
> {
>        cur="foo"
>        words="foo"
>        cwords="foo"
> }
>
> _foo ()
> {
>        local cur words cwords
>        set_vars
>
>        echo "cur=${cur} words=${words} cwords=${cwords}" >> /tmp/comp_test.txt
> }
>
> compdef _foo foo
> ---
>
> Which results in:
> cur=foo words= cwords=foo
>
> Strangely enough, if I use the #compdef tag, the code works fine (words="foo").
>
> Any ideas?

$words is a special array used for completion. See `man zshcompsys'
for more about it.

Best regards,

-- 
Jérémie



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