Home Download Buy Blog Forum Support

Snippet Implentation Error

Snippet Implentation Error

Postby mickbw on Mon Mar 12, 2012 9:23 pm

I have been able to create a few snippets that work well. This snippet doesn't work for some reason and it seems like a very simple implementation.
Code: Select all
<snippet>
                <content><![CDATA[
<script>
$(document).ready(function() {
   $0
});
</script>
]]></content>
                <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
                <tabTrigger>jqdr</tabTrigger>
               <!-- Optional: Set a scope to limit where the snippet will trigger -->
                <!-- <scope>source.python</scope> -->
                <description>jQuery document.ready</description>
</snippet>

When I type the trigger text and tab the trigger text disappears but the snippet doesn't appear.

If I try initializing by using the Ctrl+Shift+P and finding the snippet I receive an error:
Error Parsing Content for snippet
Packages/User/jqDocReady.sublime-snippet: Empty Key


I am running this on a Windows Vista PC, running SublimeText 2 rev 2181.
mickbw
 
Posts: 10
Joined: Mon Mar 12, 2012 6:20 pm

Re: Snippet Implentation Error

Postby C0D312 on Mon Mar 12, 2012 9:38 pm

You have to escape the $ with a '\'
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Snippet Implentation Error

Postby mickbw on Wed Mar 14, 2012 12:33 am

Works Perfectly. Thank you very much.

Is there a reference somewhere that says which characters need to be escaped?
mickbw
 
Posts: 10
Joined: Mon Mar 12, 2012 6:20 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 18 guests