Skip to content

Commit aa6c372

Browse files
committed
Fixed some of the templates so that they handle "surround" correctly
1 parent 823b9b0 commit aa6c372

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • resources/de/halirutan/mathematica/codeinsight/livetemplates

resources/de/halirutan/mathematica/codeinsight/livetemplates/mathematica.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<template name="cmpl" description="Compile[{vars}, body]" toReformat="true"
3131
value="Compile[{$VARS$}, $SELECTION$$END$]">
3232
<variable name="VARS" expression="" defaultValue="&quot;{x, _Real}&quot;" alwaysStopAt="true"/>
33+
<variable name="SELECTION" expression="" defaultValue="&quot;body&quot;" alwaysStopAt="true"/>
3334
<context>
3435
<option name="Mathematica" value="true"/>
3536
</context>
@@ -38,6 +39,7 @@
3839
<template name="fnct" description="Function[{vars}, body]" toReformat="true"
3940
value="Function[{$VARS$}, $SELECTION$$END$]">
4041
<variable name="VARS" expression="" defaultValue="&quot;var&quot;" alwaysStopAt="true"/>
42+
<variable name="SELECTION" expression="" defaultValue="&quot;body&quot;" alwaysStopAt="true"/>
4143
<context>
4244
<option name="Mathematica" value="true"/>
4345
</context>
@@ -48,6 +50,7 @@
4850
<template name="do" description="Do[body, {iter}]" toReformat="true"
4951
value="Do[$SELECTION$$END$, {$ITER$}]">
5052
<variable name="ITER" expression="" defaultValue="&quot;iter&quot;" alwaysStopAt="true"/>
53+
<variable name="SELECTION" expression="" defaultValue="&quot;body&quot;" alwaysStopAt="true"/>
5154
<context>
5255
<option name="Mathematica" value="true"/>
5356
</context>
@@ -57,6 +60,7 @@
5760
value="For[$VAR$ = 0, $VAR$ &lt; $MAX$, $VAR$++, $SELECTION$$END$]">
5861
<variable name="VAR" expression="" defaultValue="&quot;i&quot;" alwaysStopAt="true"/>
5962
<variable name="MAX" expression="" defaultValue="&quot;max&quot;" alwaysStopAt="true"/>
63+
<variable name="SELECTION" expression="" defaultValue="&quot;body&quot;" alwaysStopAt="true"/>
6064
<context>
6165
<option name="Mathematica" value="true"/>
6266
</context>
@@ -66,6 +70,7 @@
6670
value="Table[$SELECTION$$END$, {$VAR$, $LIMITS$}]">
6771
<variable name="VAR" expression="" defaultValue="&quot;x&quot;" alwaysStopAt="true"/>
6872
<variable name="LIMITS" expression="" defaultValue="&quot;min, max, stepSize&quot;" alwaysStopAt="true"/>
73+
<variable name="SELECTION" expression="" defaultValue="&quot;body&quot;" alwaysStopAt="true"/>
6974
<context>
7075
<option name="Mathematica" value="true"/>
7176
</context>
@@ -75,6 +80,7 @@
7580
value="Fold[$SELECTION$$END$, $FIRST$, $LIST$]">
7681
<variable name="FIRST" expression="" defaultValue="&quot;x&quot;" alwaysStopAt="true"/>
7782
<variable name="LIST" expression="" defaultValue="&quot;list&quot;" alwaysStopAt="true"/>
83+
<variable name="SELECTION" expression="" defaultValue="&quot;body&quot;" alwaysStopAt="true"/>
7884
<context>
7985
<option name="Mathematica" value="true"/>
8086
</context>
@@ -94,6 +100,7 @@
94100
<template name="if" description="If[cond, then]" toReformat="true"
95101
value="If[$COND$, $SELECTION$$END$]">
96102
<variable name="COND" expression="" defaultValue="&quot;cond&quot;" alwaysStopAt="true"/>
103+
<variable name="SELECTION" expression="" defaultValue="&quot;body&quot;" alwaysStopAt="true"/>
97104
<context>
98105
<option name="Mathematica" value="true"/>
99106
</context>

0 commit comments

Comments
 (0)