Skip to content

Commit 3beb4ba

Browse files
committed
Use older style of embedding scope in syntax highlight
1 parent b918385 commit 3beb4ba

File tree

1 file changed

+86
-63
lines changed

1 file changed

+86
-63
lines changed

Vue Component.sublime-syntax

Lines changed: 86 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ contexts:
1313
- match: "-->"
1414
scope: punctuation.definition.comment.begin.html
1515
pop: true
16-
1716
- include: template_langs
1817
- match: '(<)(template).*(>)'
1918
captures:
@@ -28,26 +27,11 @@ contexts:
2827
2: entity.name.tag.custom.html
2928
3: punctuation.definition.tag.begin.html
3029
pop: true
31-
- include: template_content
30+
- include: template_embeds
3231
- include: scripts
3332
- include: styles
34-
35-
template_langs:
36-
- match: (<)(template)\b[^>]*(lang)\s*=\s*([\'\"]pug[\'\"])\s*.*(>)
37-
captures:
38-
1: punctuation.definition.tag.begin.html
39-
2: entity.name.tag.script.html
40-
3: entity.other.attribute-name.html
41-
4: string.quoted.double.html
42-
5: meta.tag.script.end.html
43-
embed: scope:text.pug
44-
escape: (</)(template)(>)
45-
escape_captures:
46-
1: punctuation.definition.tag.begin.html
47-
2: entity.name.tag.script.html
48-
3: meta.tag.script.end.html
4933

50-
template_content:
34+
template_embeds:
5135
- match: (?:^|\s+)(v-\S+|:\S+|@\S+)\b\s*(=)\s*(")\s*
5236
captures:
5337
1: entity.other.attribute-name.event.html
@@ -58,38 +42,69 @@ contexts:
5842
scope: punctuation.definition.string.end.html string.quoted.double.html
5943
pop: true
6044
- include: scope:source.js
61-
- match: '{{'
62-
embed: 'scope:source.js'
63-
escape: '}}'
45+
- match: (?:^|\s+)(v-\S+|:\S+|@\S+)\b\s*(=)\s*(')\s*
46+
captures:
47+
1: entity.other.attribute-name.event.html
48+
2: punctuation.separator.key-value.html
49+
3: punctuation.definition.string.begin.html string.quoted.single.html
50+
push:
51+
- match: "'"
52+
scope: punctuation.definition.string.end.html string.quoted.single.html
53+
pop: true
54+
- include: scope:source.js
55+
- match: '({{)'
56+
push:
57+
- match: '(}})'
58+
pop: true
59+
- include: scope:source.js
6460

65-
scripts:
66-
- match: (<)(script)\b[^>]*(lang)\s*=\s*([\'\"]coffee[\'\"])\s*.*(>)
61+
template_langs:
62+
- match: (<)(template)\b[^>]*(lang)\s*=\s*([\'\"]pug[\'\"])\s*.*(>)
6763
captures:
6864
1: punctuation.definition.tag.begin.html
6965
2: entity.name.tag.script.html
7066
3: entity.other.attribute-name.html
7167
4: string.quoted.double.html
7268
5: meta.tag.script.end.html
73-
embed: scope:source.coffee
74-
escape: (</)(script)(>)
75-
escape_captures:
76-
1: punctuation.definition.tag.begin.html
77-
2: entity.name.tag.script.html
78-
3: meta.tag.script.end.html
79-
# If no lang is set, fall back to js
80-
- match: (<)(script).*(>)
69+
push:
70+
- match: (</)(template)(>)
71+
captures:
72+
1: punctuation.definition.tag.begin.html
73+
2: entity.name.tag.style.html
74+
3: punctuation.definition.tag.end.html
75+
pop: true
76+
- include: scope:text.pug
77+
78+
79+
scripts:
80+
- match: (<)(script)\b[^>]*(lang)\s*=\s*([\'\"]coffee[\'\"])\s*.*(>)
8181
captures:
8282
1: punctuation.definition.tag.begin.html
8383
2: entity.name.tag.script.html
8484
3: entity.other.attribute-name.html
8585
4: string.quoted.double.html
8686
5: meta.tag.script.end.html
87-
embed: scope:source.js
88-
escape: (</)(script)(>)
89-
escape_captures:
87+
push:
88+
- match: (</)(script)(>)
89+
pop: true
90+
captures:
91+
1: punctuation.definition.tag.begin.html
92+
2: entity.name.tag.script.html
93+
3: meta.tag.script.end.html
94+
- include: scope:source.coffee
95+
- match: (<)(script).*(>)
96+
captures:
9097
1: punctuation.definition.tag.begin.html
9198
2: entity.name.tag.script.html
92-
3: meta.tag.script.end.html
99+
3: punctuation.definition.tag.end.html
100+
push:
101+
- match: (</)(script)(>)
102+
captures:
103+
1: punctuation.definition.tag.begin.html
104+
2: entity.name.tag.script.html
105+
3: punctuation.definition.tag.end.html
106+
pop: true
107+
- include: scope:source.js
93108

94109
styles:
95110
- match: (<)(style)\b[^>]*(lang)\s*=\s*([\'\"]stylus[\'\"])\s*.*(>)
@@ -99,49 +114,57 @@ contexts:
99114
3: entity.other.attribute-name.html
100115
4: string.quoted.double.html
101116
5: meta.tag.script.end.html
102-
embed: scope:source.stylus
103-
escape: (</)(style).*(>)
104-
escape_captures:
105-
1: punctuation.definition.tag.begin.html
106-
2: entity.name.tag.script.html
107-
3: meta.tag.script.end.html
117+
push:
118+
- match: (</)(style)(>)
119+
captures:
120+
1: punctuation.definition.tag.begin.html
121+
2: entity.name.tag.style.html
122+
3: punctuation.definition.tag.end.html
123+
pop: true
124+
- include: scope:source.stylus
125+
108126
- match: (<)(style)\b[^>]*(lang)\s*=\s*([\'\"]sass[\'\"])\s*.*(>)
109127
captures:
110128
1: punctuation.definition.tag.begin.html
111129
2: entity.name.tag.script.html
112130
3: entity.other.attribute-name.html
113131
4: string.quoted.double.html
114132
5: meta.tag.script.end.html
115-
embed: scope:source.sass
116-
escape: (</)(style).*(>)
117-
escape_captures:
118-
1: punctuation.definition.tag.begin.html
119-
2: entity.name.tag.script.html
120-
3: meta.tag.script.end.html
133+
push:
134+
- match: (</)(style)(>)
135+
captures:
136+
1: punctuation.definition.tag.begin.html
137+
2: entity.name.tag.style.html
138+
3: punctuation.definition.tag.end.html
139+
pop: true
140+
- include: scope:source.sass
121141
- match: (<)(style)\b[^>]*(lang)\s*=\s*([\'\"]scss[\'\"])\s*.*(>)
122142
captures:
123143
1: punctuation.definition.tag.begin.html
124144
2: entity.name.tag.script.html
125145
3: entity.other.attribute-name.html
126146
4: string.quoted.double.html
127147
5: meta.tag.script.end.html
128-
embed: scope:source.scss
129-
escape: (</)(style).*(>)
130-
escape_captures:
131-
1: punctuation.definition.tag.begin.html
132-
2: entity.name.tag.script.html
133-
3: meta.tag.script.end.html
148+
push:
149+
- match: (</)(style)(>)
150+
captures:
151+
1: punctuation.definition.tag.begin.html
152+
2: entity.name.tag.style.html
153+
3: punctuation.definition.tag.end.html
154+
pop: true
155+
- include: scope:source.scss
156+
134157
- match: (<)(style).*(>)
135158
captures:
136159
1: punctuation.definition.tag.begin.html
137-
2: entity.name.tag.script.html
138-
3: meta.tag.script.end.html
139-
embed: scope:source.css
140-
escape: (</)(style).*(>)
141-
escape_captures:
142-
1: punctuation.definition.tag.begin.html
143-
2: entity.name.tag.script.html
144-
3: meta.tag.script.end.html
145-
146-
160+
2: entity.name.tag.style.html
161+
3: punctuation.definition.tag.end.html
162+
push:
163+
- match: (</)(style)(>)
164+
captures:
165+
1: punctuation.definition.tag.begin.html
166+
2: entity.name.tag.style.html
167+
3: punctuation.definition.tag.end.html
168+
pop: true
169+
- include: scope:source.css
147170

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy