Problem Statement
Some configs snippet expansions I want to do would require expanding the placeholder inside of the eval expression. Would be possible to support that as a feature?
An example of what I'm trying to accomplish, basically to break the line automatically if I hit enter in the $2 placeholder.
snippet f "Anonymous function" i
function (${1})${2: }$3 `!lua "$2" == "\n" and "\n" or ""`end${0}
Ideas or possible solutions
I think it could maybe be solved by expanding $2 inside the string of the enclosed eval expression, but that would require re-evaluating the eval expression each time the placeholders are updated.
Alternatives you have considered
Alternatively, this could be exposed as a function call:
snippet f "Anonymous function" i
function (${1})${2: }$3 `!lua require("snippy").expand("$2") == "\n" and "\n" or ""`end${0}
Problem Statement
Some configs snippet expansions I want to do would require expanding the placeholder inside of the eval expression. Would be possible to support that as a feature?
An example of what I'm trying to accomplish, basically to break the line automatically if I hit enter in the
$2placeholder.Ideas or possible solutions
I think it could maybe be solved by expanding $2 inside the string of the enclosed eval expression, but that would require re-evaluating the eval expression each time the placeholders are updated.
Alternatives you have considered
Alternatively, this could be exposed as a function call: