Sublime Forum

Display curly brackets using <language>.sublime-completions?

#1

Hi,

I’m currently populating my xys.sublime-completions file and I have one minor problem atm:

{ "trigger": "catalogreport", "contents": "catalogreport (\"${1:template_category = {Caption} | {Location}}\");" },

Triggers on “catalogreport” but will only highlight the content of the variable up to:
http://img706.imageshack.us/img706/3217/screenshot26eg.jpg

Escaping all curly brackets inside the variable definition doesn’t have the expected result, after that, the command won’t be triggered at all.

{ "trigger": "catalogreport", "contents": "catalogreport (\"${1:template_category = \{Caption\} | \{Location\}}\");" },

How else do I have to write it to highlight the complete content while still displaying the curly brackets for Caption and Location?

Tia,
Highend

0 Likes

#2

You need to escape the dollar sign, using two back slashes, as the contents are interpreted as a snippet

0 Likes

#3
{ "trigger": "catalogreport", "contents": "catalogreport (\"\\${1:template_category = {Caption} | {Location}}\");" },

In that case I don’t get any highlighting / selection at all :frowning:

0 Likes

#4

I’m wondering the same thing. There seems to be no way to include a closing curly braces within a snippet tab stop. As soon as you put a closing curly braces in, even if there is an opening curly braces within the text, it closes the tab stop instead of placing a literal } within the tab stop.

0 Likes

#5

Actually I found using double backslash before the curly brace you wish to escape works. so the entire escape becomes \}

0 Likes