gustavo-hms / luar

Script Kakoune using Lua
GNU Lesser General Public License v3.0
47 stars 3 forks source link

Fix argument forwarding #8

Closed alexherbo2 closed 4 years ago

gustavo-hms commented 4 years ago

Hi again!

I remember vaguely that, when I was writing this plugin, the first versions didn't use $kak_quoted_$@, but $@ instead, as in your patch. But I can't remember now why I changed that. I guess it has something to do with quoting the Lua code. As I've explained in #9, all the arguments passed to the :lua command are forwarded to the luar.lua script as command line arguments. By all the arguments, I mean even the Lua code within %{}. I think I was concerned that we could experiment some problems if I didn't use the quoted variant.

Do you think it's unnecessary?

And also you named it a fix. Does it break something on your side? If so, could you give me some example for me to understand theses nuances better?

By the way, quoting the luar path is really important.

alexherbo2 commented 4 years ago

I’m not sure $kak_quoted_$@ is a thing. $kak_quoted_ expands to nothing and $@ the arg list.

gustavo-hms commented 4 years ago

OK. I'm merging it then. If it breaks someone else's code, we will discover =)