Repeatable fields?

46 views
Skip to first unread message

Ian Tegebo

unread,
Jul 22, 2016, 5:15:08 AM7/22/16
to YASnippet Discussion Group
I believe this has been requested before, but I'd like to have repeatable fields.  In reading the code, it appears that one would need to adjust linkages between fields as code seems to assume a fixed number and ordering between fields.  Are they somehow already available?  If not, has anyone any deeper insight into implementing them?

For example, consider switch/case statements:


I'd like to have a snippet that allows a flexible number of cases.  Outside of Java, consider Common Lisp; a variety of macros take a variable length sequence of expressions often terminated by some boilerplate:

Anders Eurenius

unread,
Jul 22, 2016, 7:38:28 AM7/22/16
to YASnippet Discussion Group
The usual way to do this is to just have a snippet for case. :)

There's a way to do optional else clauses by letting the user either tab past, or delete a variable defaulting to the else part, see https://joaotavora.github.io/yasnippet/snippet-development.html#sec-3-9 (Nested placeholder fields)


--
You received this message because you are subscribed to the Google Groups "YASnippet Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smart-snippe...@googlegroups.com.
To post to this group, send email to smart-...@googlegroups.com.
Visit this group at https://groups.google.com/group/smart-snippet.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages