Home Download Buy Blog Forum Support

snippet weird behavior

snippet weird behavior

Postby greg on Fri Sep 21, 2012 8:41 am

Hello community

I wrote a snippet which trigger is TOTO.

In a file, I write:

TO<tab>
gives me TOTO
TOTO<tab>
replace TOTO by TODO
TODO<tab>
gives me
touch(filename)

If instead I write:
hello TOTO<tab>
the trigger is cleared and only "hello" remains

I'm new to ST2 but I guess it's not the intended behavior.

How do I get my snippet working?

TIA

greg
greg
 
Posts: 34
Joined: Fri Sep 14, 2012 10:00 am

Re: snippet weird behavior

Postby greg on Fri Sep 21, 2012 8:52 am

I found the solution for one of the two problem: dollar signs must be escaped.

I still don't understand the first part...
greg
 
Posts: 34
Joined: Fri Sep 14, 2012 10:00 am

Re: snippet weird behavior

Postby greg on Sat Sep 29, 2012 10:30 am

No one understand this snippet behavior?
greg
 
Posts: 34
Joined: Fri Sep 14, 2012 10:00 am

Re: snippet weird behavior

Postby AGS on Sat Sep 29, 2012 4:24 pm

Why not actually post your snippet code?
AGS
 
Posts: 32
Joined: Mon Aug 20, 2012 5:58 pm

Re: snippet weird behavior

Postby greg on Sun Sep 30, 2012 10:27 am

Really simple:

Code: Select all
<snippet>
   <content><![CDATA[
Hello, ${1:this} is a ${2:snippet}.
]]></content>
   <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
   <tabTrigger>TOTO</tabTrigger>
   <!-- Optional: Set a scope to limit where the snippet will trigger -->
   <scope>source.php</scope>
</snippet>
greg
 
Posts: 34
Joined: Fri Sep 14, 2012 10:00 am


Return to General Discussion

Who is online

Users browsing this forum: applejosh, Yahoo [Bot] and 15 guests