Ross Donaldson <
gas...@gmail.com> writes:
> Hullo all --
>
> First off: yasnippet has saved me so much time. Thanks to all the creators!
> Great stuff.
>
> Question: I want to insert text based on evaluating a conditional
> expression, and then I want a tab field. I imagine this working like so
> (example imagines YAML mode, but I doubt that matters):
>
> field_one: ${1:default}
> field_two: ${2:default}
> `(if(my-predicate-fn)
> "field_three_a: "
> "field_three_b: ")`$3
> $0
This seems to be the same question as your previous message (if it's not
please tell me).
Anyway, your example looks fine. I don't know what `my-predicate-fn`
does, but I've just tested something similar which works fine:
${1:foo}
`(if (zerop (random 2)) "bar: " "baz: ")`$2
$0
Can you open an issue in
https://github.com/capitaomorte/yasnippet/issues ?
Be sure to read the README.md for guidelines when reporting issues
though (I need to be able to reproduce it just like it happened to you.)
João