Skip to content

Commit a5ded98

Browse files
bors[bot]ehuss
andcommitted
Merge #381
381: Explicitly set the "exit" point on some snippets. r=ehuss a=ehuss Often when using a snippet, when you tab into the main "body" of the snippet, it is still in snippet mode. This means that hitting tab will exit the body. This is almost never what I want, since it disables tab completion. Co-authored-by: Eric Huss <[email protected]>
2 parents 34eaab1 + a728e96 commit a5ded98

20 files changed

+20
-20
lines changed

snippets/Ok.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<snippet>
2-
<content><![CDATA[Ok(${1:result})]]></content>
2+
<content><![CDATA[Ok(${0:result})]]></content>
33
<tabTrigger>Ok</tabTrigger>
44
<scope>source.rust</scope>
55
<description>Ok(…)</description>

snippets/Some.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<snippet>
2-
<content><![CDATA[Some(${1})]]></content>
2+
<content><![CDATA[Some(${0})]]></content>
33
<tabTrigger>Some</tabTrigger>
44
<scope>source.rust</scope>
55
<description>Some(…)</description>

snippets/bench.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<content><![CDATA[
33
#[bench]
44
fn ${1:name}(b: &mut test::Bencher) {
5-
${2:b.iter(|| ${3:/* benchmark code */})}
5+
${2:b.iter(|| ${0:/* benchmark code */})}
66
}]]></content>
77
<tabTrigger>bench</tabTrigger>
88
<scope>source.rust</scope>

snippets/extern-fn.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<snippet>
22
<content><![CDATA[extern "C" fn ${1:name}(${2:arg}: ${3:Type}) -> ${4:RetType} {
3-
${5:// add code here}
3+
${0:// add code here}
44
}]]></content>
55
<tabTrigger>extern-fn</tabTrigger>
66
<scope>source.rust</scope>

snippets/extern-mod.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<snippet>
22
<content><![CDATA[extern "C" {
3-
${2:// add code here}
3+
${0:// add code here}
44
}]]></content>
55
<tabTrigger>extern-mod</tabTrigger>
66
<scope>source.rust</scope>

snippets/fn.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<snippet>
22
<content><![CDATA[fn ${1:name}(${2:arg}: ${3:Type}) ${4/(^.+$)|^$/(?1:-> :)/}${4:RetType}${4/(^.+$)|^$/(?1: :)/}{
3-
${5:unimplemented!()}
3+
${0:unimplemented!()}
44
}]]></content>
55
<tabTrigger>fn</tabTrigger>
66
<scope>source.rust</scope>

snippets/for.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<snippet>
22
<content><![CDATA[for ${1:pat} in ${2:expr} {
3-
${3:unimplemented!();}
3+
${0:unimplemented!();}
44
}]]></content>
55
<tabTrigger>for</tabTrigger>
66
<scope>source.rust</scope>

snippets/if-let.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<snippet>
22
<content><![CDATA[if let ${1:Some(pat)} = ${2:expr} {
3-
${3:unimplemented!();}
3+
${0:unimplemented!();}
44
}]]></content>
55
<tabTrigger>if-let</tabTrigger>
66
<scope>source.rust</scope>

snippets/if.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<snippet>
22
<content><![CDATA[if ${1:condition} {
3-
${2:unimplemented!();}
3+
${0:unimplemented!();}
44
}]]></content>
55
<tabTrigger>if</tabTrigger>
66
<scope>source.rust</scope>

snippets/impl-trait.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<snippet>
22
<content><![CDATA[impl ${1:Trait} for ${2:Type} {
3-
${3:// add code here}
3+
${0:// add code here}
44
}]]></content>
55
<tabTrigger>impl-trait</tabTrigger>
66
<scope>source.rust</scope>

0 commit comments

Comments
 (0)