Sublime Forum

[BUG] Perform snippet within a snippet

#1

I have the following two snippets:

First Snippet:

[code]
<![CDATA[
This is a ${1:snippet}.

I also want a $2 to go here.
]]>

tst1


[/code]

Second Snippet:

<snippet> <content><![CDATA[snippet]]></content> <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> <tabTrigger>snp</tabTrigger> <!-- Optional: Set a scope to limit where the snippet will trigger --> <!-- <scope>source.python</scope> --> </snippet>

Execute first snippet:

tst1[TAB]

Outputs:

This is a snippet**[cursor1]**.

(then hitting TAB once places [cursor2] below)

I also want a [cursor2]snp(hitting TAB here causes the cursor to reach the end of the document at [cursor3], without the ‘snp’ snippet performing correctly) to go here.[cursor3]

When I manually put the cursor at snp and hit TAB again, the snippet then fires correctly. The bug is that it doesn’t fire correctly the first time.

This is occurring in Mac and Windows versions v2.0.1, Build 2217

Hope this makes sense.

1 Like

#2

Sounds like same as this question on SO (also unanswered, unfortunately).

0 Likes