I’m trying to create a custom comment using $SELECTION. By using only $SELECTION…
<div>
<p>hi</p>
</div>
transforms into
<div>
<p>hi</p>
</div>
How do I retain the original tabs as the original?
I’m trying to create a custom comment using $SELECTION. By using only $SELECTION…
<div>
<p>hi</p>
</div>
transforms into
<div>
<p>hi</p>
</div>
How do I retain the original tabs as the original?
I can’t replicate this on build 3140
snippet:
<snippet>
<content><![CDATA[
$SELECTION
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
document, syntax set to HTML:
<div>
<p>hi</p>
</div>
steps followed:
Sorry, I should have been more specific.
I’m using babel sublime, and it occurs within JSX elements.
function foo() {
return (
<div>
<p>hi</p>
</div>
)
}
Everything works fine outside the JSX statement.
Any idea as to why this may be happening?
Build 3126
Thanks
thanks for the example, I can confirm that I get the same behavior - I wonder why, because when I tried a different snippet, it didn’t auto indent (though maybe that was due to the line that would get indented being a comment?)
I’ll try to explore it further when I get time, it may be that one will need to hook into the insert_snippet
command to set smart_indentation
to false
before the command is triggered, and back to true
again afterwards, to work around it