Home Download Buy Blog Forum Support

Can't make my snippets

Can't make my snippets

Postby eric1235711 on Thu Feb 12, 2009 6:34 pm

Hello,

I'm trying to make some snippets for C# but it behaves like I'm not editing the right files. :cry:

I made a if.sublime-snippet in C:\Documents and Settings\eric\Application Data\Sublime Text\Packages\C#\ as follows:

Code: Select all
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
   <content><![CDATA[
if (${0:$SELECTION})
{
   ${1} // alala alala
}
${2}
]]></content>
</snippet>


And Default.sublime-keymap in the same dir is:

Code: Select all
   <binding key="i,f,tab" command="insertSnippet 'Packages/C#/if.sublime-snippet'">
      <context name="selector" value="source.cs"/>
   </binding>


the "// alala alala" test thing don't come when I call the snippet

Any one can help me please?

thanx in advance!
0xhexakosioikexekontahexaphilia
eric1235711
 
Posts: 23
Joined: Thu Mar 27, 2008 3:54 pm

Re: Can't make my snippets

Postby jps on Thu Feb 12, 2009 9:39 pm

This is a bug in sublime: in the Packages/C++/Default.sublime-keymap, the entry is:

Code: Select all
<bindings>
   ...
   <binding key="i,f,tab" command="insertSnippet 'Packages/C++/if.sublime-snippet'">
      <context name="selector" value="source.c++, source.c"/>
   </binding>
</bindings>


The "source.c" entry there is overriding your "source.cs" entry.

You can remove the "source.c" part of the above keymap, and it'll work.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Can't make my snippets

Postby eric1235711 on Thu Feb 12, 2009 11:13 pm

oh thanks!

it doesn't matter, tha basic ones, I will keep with C++.

;)
0xhexakosioikexekontahexaphilia
eric1235711
 
Posts: 23
Joined: Thu Mar 27, 2008 3:54 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 32 guests