Sublime Forum

Help with syntax highlight in custom theme

#1

I am trying to highlight a specific tag, for the whole line (). I want to set the background color for opening and closing of embedded CSS in a ColdFusion file. I have been able to do this with CFOUTPUT and CFQUERY tags by using:

[code]text.html.cfm meta.tag.block.cf.output.cfml

text.html.cfm meta.tag.block.cf.query[/code]

However, this only highlights the word “style” inside of the tag - while I want the whole tag (or whole line) highlighted as CFOUTPUT and CFQUERY do:

text.html.cfm source.css.embedded.html entity.name.tag.style

I grabbed those from the ctrl+alt+shift+p key combo, but can’t seem to find what makes it highlight only the word and not the whole tag. Is it since it is HTML and not ColdFusion specific?

0 Likes

#2

Could you post an example to show what you’re trying to highlight, what you’re seeing with those selectors, and what you want to see instead? If you can’t completely describe it, remember an image is worth 1000 words :smile:

0 Likes

#3

I’ll try guessing:

If you want to highlight the whole line the tag is in, you probably need to modify the syntax definition itself because it requires some specific scoping. If you can do so, I could explain how.

If you only want to highlight the angle brackets, you have to look for their respective scope (by inspecting with ctrl+shift+alt+p). If they don’t have one, you must edit the syntax definition.

Otherwise, a screenshot or an example file (and the syntax definition in question) would help.

0 Likes