Sublime Forum

ST2 Snippets - calculate one field from another

#1

Hi All,
Is it possible within a snippet to take the value of a field and use that to set the placeholder for another field?

I currently have three fields, but the values for these are all linked:
default = ${1:128}
type = ltp${2:8}bit
range = 0, ${3:255}, %

$1 is $3/2
$3 is ($2*32)-1

I would like to be able to set $2 and $1 and $3 will be set automatically.

Thanks in advance

0 Likes