Sublime Forum

Snippets fail with special characters

#1

Is there a trick to enable snippets to work with special characters?
i.e. I tried to set up an HTML basic framework, which failed in the beginning. It just erases the typed tab trigger.
I found out that it was a simple paragraph showing some special characters.
So also a jquery snippet is not possible supposedly for the same reason.

Is there a trick, is this a bug or is this intended to be like this?

Thanks for any hints.

0 Likes

#2

Not sure of the exact issue, but the following file setting enables auto complete and snippets to be triggered by a non-alphabetic character:

// Additional situations to trigger auto complete "auto_complete_triggers": {"selector": "text.html", "characters": "<"} ],

Depending on how you are creating a snippet, some characters need to be double, or single, escaped: \"

Dollar signs and apostrophes in particular can be troublesome. Sometimes you may need to use a hex code: \x27

0 Likes

#3

Please give a concrete example of the snippet you’re using

0 Likes

#4

I am trying to make a snippet that contains $_SERVER’DOCUMENT_ROOT’] but when it pastes it removes the $_SERVER and inserts:

‘DOCUMENT_ROOT’]

0 Likes

#5

$

0 Likes