I have a sublime text 2 snippet like this:
on('${1:click}', ${2:'$3', }function (e) {
$0
return false;
});
If I trigger the snippet first is highlighted click
, next is highlighted '',
and here I have an option to either enter a value with the next tab hit or just delete the selected text if I don't want to use this highlighted block at all.
The problem is if I hit Delete to delete the highlighted text I want with the next tab hit to jump to the next var which in this case is $0. But instead I get a blank tab hit for the $3 var which is inside of the deleted block of var $2.
For example the way E-texteditor work is: If I delete some var which contains another var inside of it then I hit tab again I jump directly to the next after the deleted var not inside of it.
Is this possible to achieve with Sublime Text 2?
I hope you understand my question, here is the entire snippet code:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>m2k-on</string>
<key>uuid</key>
<string>6D67B0C4-96B1-4986-902B-2F6ACC17403F</string>
<key>tabTrigger</key>
<string>on</string>
<key>content</key>
<string>on('${1:click}', ${2:'$3', }function (e) {
$0
return false;
});</string>
</dict>
</plist>
Copy paste it in new snippet file to test it.