Skip to content

Commit

Permalink
Fix HTML/XML abbreviation scopes
Browse files Browse the repository at this point in the history
Fixes emmetio#184
Fixes Sublime-Instincts/BetterTwig#40

This commit fixes abbreviations being disabled in various template syntaxes
such as Jinja2 or Twig, which use common `text.html meta.template` scope to
enable template related snippets and completions in all sub-syntaxes with
easy/short selectors.

Instead of excluding all meta scopes by `- meta`, only relevant ones are,
which indicate embedded or interpolated templating code or html tags.

`text.html.cfml - meta.tag` is removed as it is coverd by
`text.html - text.html meta.tag`.

Note each negative selector is prefixed with `text.html` to make sure to match
only parts within HTML/XML, even if it is embedded in another source code.
That's required to keep abbreviations working in e.g. `source.astro text.html`.
  • Loading branch information
deathaxe committed Dec 9, 2024
1 parent 9484806 commit 5f72b88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Emmet.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
// List of scope selectors where abbreviation marker should be activated,
// e.g. plugin will mark text that user types as abbreviation
"abbreviation_scopes": [
"(text.html | text.xml) - source - meta - comment",
"text.html - text.html meta.tag - text.html meta.embedded - text.html meta.interpolation - text.html comment - text.html source",
"text.xml - text.xml meta.tag - text.xml meta.embedded - text.xml meta.interpolation - text.xml comment - text.xml source",
"source.sass - meta.property-value - meta.property-name - string - punctuation - comment",
"(source.css | source.scss | source.less | source.postcss | source.stylus) & meta.property-list",
"(source.css | source.scss | source.less | source.postcss | source.stylus) - meta.property-value - meta.property-name - string - comment",
"(source.tsx | source.js | source.jsx) - comment",
"text.html.cfml - meta.tag",
// Inline CSS
"text.html meta.attribute-with-value.style (string.quoted | source.css)"
],
Expand Down

0 comments on commit 5f72b88

Please sign in to comment.