Thom1729 / Sublime-JS-Custom

Customizable JavaScript syntax highlighting for Sublime Text.
MIT License
137 stars 9 forks source link

Overriding styling of template tags? #60

Closed Twipped closed 5 years ago

Twipped commented 5 years ago

I'd like to alter the styling of template strings so that the background color differs from other code (otherwise the new scope kinda blends in with the JS scope and it isn't obvious at first glance that it's a template).

Is there a way to accomplish this via configuration, or would I have to edit the package?

Twipped commented 5 years ago

I dug into the source of the package and discovered that, no, this isn't available, but I managed to get the effect I wanted by adding string.template.js to my theme's Embedded Source scope list. This wasn't a full success, however, as it only changed the background of the template tag and backticks.

Adding - meta_content_scope: source right after the meta_scope: string.template.js definition for each tagged template solved this problem, but so did removing the clear_scopes line.

Thom1729 commented 5 years ago

The core JavaScript syntax should probably be using meta.string.template string.template or the like for template strings. If it did, then JS Custom would follow suit, and you could style meta.string.template. If you open an issue in the core Packages repo, then I'll try to get to it soon.