Home Download Buy Blog Forum Support

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

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

Postby highend on Fri Jan 27, 2012 10:27 am

Hi,

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

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


Triggers on "catalogreport" but will only highlight the content of the variable up to:
Image

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

Code: Select 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
highend
 
Posts: 94
Joined: Fri Jan 20, 2012 2:47 pm

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

Postby jps on Fri Jan 27, 2012 11:35 am

You need to escape the dollar sign, using two back slashes, as the contents are interpreted as a snippet
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

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

Postby highend on Fri Jan 27, 2012 11:55 am

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


In that case I don't get any highlighting / selection at all :(
highend
 
Posts: 94
Joined: Fri Jan 20, 2012 2:47 pm

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

Postby senilebob on Sun Feb 12, 2012 12:13 pm

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.
senilebob
 
Posts: 1
Joined: Sun Feb 12, 2012 12:09 pm

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

Postby daytonn on Mon Jul 22, 2013 5:17 pm

Actually I found using double backslash before the curly brace you wish to escape works. so the entire escape becomes \\}
daytonn
 
Posts: 1
Joined: Mon Jul 22, 2013 5:16 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 19 guests