-
Notifications
You must be signed in to change notification settings - Fork 312
Open
Description
Consider this snippet.
# -*- mode: snippet -*-
# name: example
# key: example
# --
${1:variable} ${2:$$(unless yas-modified-p (format "++%s" (yas-field-value 1)))}
$0
The default expansion is variable ++variable. The intended usage is in defining a c-style loop snippet. Usually when you first enter into a tab stop, typing x will remove the placeholder and replace it with x. However, on the second tab stop in this snippet, typing x will leave you with variable ++variablex instead of the more consistent variable x.
Hence, making a field value with a transform makes it "sticky" and it doesn't behave like other fields.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels