I am new to Sublime Text 2, and I am trying to create my own snippet. It is going to be a click function, because I use these quite often. From what I understand at this article, I can use ${1:text} to have that text selected first when I open the function. I am trying to wrap this around the selector. This is my code so far
<snippet>
<content><![CDATA[
jQuery("${1:div}").on("click", function () {
$0
});
]]></content>
<tabTrigger>clickf</tabTrigger>
</snippet>
I have to use jQuery, because $ breaks the tab selection. So from my understanding, div should be selected. And if there are no indents, it works fine. But I have code that looks like this
<section>
<div>
<article>
clickf --> tab this text
</article>
</div>
</section>
The text that is selected is not div anymore. I am unsure of why this behavior is occurring. The number of characters is still the right length, but the text that is selected is now closer to the beginning.