Sublime Forum

Snippets stopped working

#1

Hello,

I updated Sublime Text to build 3103 yesterday. Since then my snippets stopped working.

/Users/…/Library/Application Support/Sublime Text 3/Packages/User/Genesis/snippets/

is the location of my snippet files.

Sample snippet name: add-post-navigation.sublime-snippet

and the code inside:

<snippet>
	<content><![CDATA[
// Add post navigation
add_action( 'genesis_after_loop', 'genesis_prev_next_post_nav' );
]]></content>
	<description>Add post navigation (previous/next) for single Posts in Genesis</description>
	<scope>source.php.embedded.block.html</scope>
</snippet>

Please advise.

0 Likes

#2

You need to adjust the snippet’s scope selector. Because of updates to the HTML and php syntax definitions the scope for php source changed. Use ctrl+alt+shift+p in a php file to see the new scope.

0 Likes

#3

How did you get your hands on sublime 3103? Latest one on the site is 3102…

0 Likes

#4

3103 and 3102 are the same, but 3103 is in the public releases while 3102 is in the dev releases

0 Likes

#5

Can you please elaborate?

I am using a Mac and pressing ctrl+alt+shift+p does not do anything (when working inside a saved php file). I tried cmd+alt+shift+p as well.

What should

<scope>source.php.embedded.block.html</scope>

be changed to in the above snippet to make it work?

0 Likes

#6

For OSX any out of super+alt+p or ctrl+shift+p works.

I could check it myself now and you can just change it to source.php.

0 Likes

#7

Well this is strange, I’ve updated my package to work with the latest release and while the new scope (text.blade) works fine if I disable the package and my snippets locally, the sublime.package from Package Control doesn’t work. :confused:

Any idea what might have go wrong?

0 Likes

#8

Neverrmind removing / reinstalling the package seems to have made it work. Kinda strange behavior though.

0 Likes