Snippets with duplicate variables to repeat text


#1

I would like to create a snippet that uses the same variable twice:

context "some context" do
  ...
end # some context

So I tried creating a snippet:

context "$1" do
  $2
end # $1

But it did not do what I wanted. Is there an easy way to do what I want?


#2

What did it do? That might help diagnose your issue.


#3

Pretty easy to reproduce :smile:

It jumped to the $1 at the end and did not fill in the initial $1 when I filled it in. That’s as far as I bothered, since it clearly was not doing what I’d hoped.