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

unset "hash[key]" isn't matched with what "key" may be



Hello,
I was testing following plugin:

https://github.com/hchbaw/opp.zsh

It creates functions with sophisticated names, like

opp+aB                               opp+aW
opp+a"                               opp+a'
opp+a(                               opp+a)
opp+a<                               opp+a>
opp+a[                               opp+a]


I had a loop in which I browsed $functions, setting:

                func[$i]=1

where "func" is a hash and "$i" is ${(k)functions}. This worked, however this:

                unset "func[$i]"

yielded:

-zplg-diff-functions:unset:36: func[opp+a\[]: invalid parameter name

Tried ${(q)i}, qq, qqq, qqqq.

Related code:

https://github.com/psprint/zplugin/commit/61a59fe0e2e367b3536fb028f4a36e9730322402

Best regards,
Sebastian Gniazdowski



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