Closed sucrecacao closed 3 years ago
Hi, @sucrecacao !
As we can read from the docs:
Expansions are processed when unquoted and anywhere inside double-quoted strings, but not inside unquoted words, inside single-quoted strings, or inside %-strings or other expansions.
So, the %val{selections_length}
expansion is not processed inside the lua %{}
code block simply because expansions are not processed inside %-strings. To achieve what you want, I see two options:
The following works as expected:
lua " kak.set_option('-add', 'buffer', 'lengths', %val{selections_length}) "
You can also do what the Luar docs suggests:
lua %val{selections_length} %{
kak.set_option('-add', 'buffer', 'lengths', arg[1])
}
Both options work, so you can choose whichever best fits for you.
How can I have the following code add the current selection length and not literally "%val{selection_length}":