@@ -25,7 +25,7 @@ first_line_match: |-
25
25
26
26
contexts :
27
27
main :
28
- - match : ^ (?={{git_first_line}})
28
+ - match : (?={{git_first_line}})
29
29
embed : Packages/Git Formats/Git Diff.sublime-syntax#email-first-line
30
30
escape : (?!)
31
31
# Hack for unit tests
@@ -47,24 +47,24 @@ contexts:
47
47
diff-header :
48
48
- meta_prepend : true
49
49
# https://www.gnu.org/software/diffutils/manual/diffutils.html#Detailed-Context
50
- - match : ^ (\*{15}){{eol}}
50
+ - match : ' {{bol}} (\*{15}){{eol}}'
51
51
scope : meta.separator.diff
52
52
captures :
53
53
1 : punctuation.separator.block.diff
54
- - match : ^ (\*{3})[ ](?!$)
54
+ - match : ' {{bol}} (\*{3})[ ](?!$)'
55
55
captures :
56
56
1 : punctuation.definition.from-file.diff
57
57
push : diff-header-context-from-file
58
58
59
59
# https://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn.c.patch
60
- - match : ^ (={67}|={78}|_{67}){{eol}}
60
+ - match : ' {{bol}} (={67}|={78}|_{67}){{eol}}'
61
61
scope : meta.separator.diff
62
62
captures :
63
63
1 : punctuation.separator.block.diff
64
64
65
65
# File headers from extensions and SVN
66
66
- match : |-
67
- ^ (?x:(
67
+ {{bol}} (?x:(
68
68
Added | Copied | Deleted | Index | Modified
69
69
| Prereq | Property [ ] changes [ ] on
70
70
))(:)[ \t]*
@@ -75,7 +75,7 @@ contexts:
75
75
76
76
# Can't find documentation for these "="-formatted headers, but there
77
77
# are preexisting unit tests.
78
- - match : ^ (={4}) .+(?= - )
78
+ - match : ' {{bol}} (={4}) .+(?= - )'
79
79
scope : meta.diff.header.from-file meta.header.from-file.diff
80
80
captures :
81
81
1 : punctuation.definition.from-file.diff
@@ -106,7 +106,7 @@ contexts:
106
106
- include : timestamps
107
107
108
108
maybe-diff-header-context-to-file :
109
- - match : ^ (-{3})[ ](?!$)
109
+ - match : ' {{bol}} (-{3})[ ](?!$)'
110
110
captures :
111
111
1 : punctuation.definition.to-file.diff
112
112
push : diff-header-context-to-file
@@ -125,20 +125,20 @@ contexts:
125
125
diff-line-ranges :
126
126
- meta_prepend : true
127
127
# https://www.gnu.org/software/diffutils/manual/diffutils.html#Hunks
128
- - match : ^ -{3}{{eol}}
128
+ - match : ' {{bol}} -{3}{{eol}}'
129
129
scope : meta.separator.diff punctuation.separator.block.diff
130
- - match : ^ \d+(?:(,)\d+)*(a|d|c)\d+(?:(,)\d+)*{{eol}}
130
+ - match : ' {{bol}} \d+(?:(,)\d+)*(a|d|c)\d+(?:(,)\d+)*{{eol}}'
131
131
scope : meta.diff.range.normal meta.range.normal.diff
132
132
captures :
133
133
1 : punctuation.separator.range.diff
134
134
2 : support.function.diff
135
135
3 : punctuation.separator.range.diff
136
136
137
137
# https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-Context
138
- - match : ^ (-){3}(?= .+ -{4}{{eol}})
138
+ - match : ' {{bol}} (-){3}(?= .+ -{4}{{eol}})'
139
139
scope : punctuation.definition.range.begin.diff
140
140
push : inside-diff-line-ranges-context
141
- - match : ^ (\*){3}(?= .+ \*{4}{{eol}})
141
+ - match : ' {{bol}} (\*){3}(?= .+ \*{4}{{eol}})'
142
142
scope : punctuation.definition.range.begin.diff
143
143
push : inside-diff-line-ranges-context
144
144
@@ -155,34 +155,34 @@ contexts:
155
155
diff-deltas :
156
156
- meta_prepend : true
157
157
# https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-Normal
158
- - match : ^ > ?
158
+ - match : ' {{bol}} > ?'
159
159
scope : punctuation.definition.inserted.diff
160
160
push : line-inserted
161
- - match : ^ < ?
161
+ - match : ' {{bol}} < ?'
162
162
scope : punctuation.definition.deleted.diff
163
163
push : line-deleted
164
164
165
165
# https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-Context
166
- - match : ^ \+ ?
166
+ - match : ' {{bol}} \+ ?'
167
167
scope : punctuation.definition.inserted.diff
168
168
push : line-inserted
169
- - match : ^ - ?
169
+ - match : ' {{bol}} - ?'
170
170
scope : punctuation.definition.deleted.diff
171
171
push : line-deleted
172
- - match : ^ ! ?
172
+ - match : ' {{bol}} ! ?'
173
173
scope : punctuation.definition.changed.diff
174
174
push : line-changed
175
175
176
176
# ##[ DIFF3 ]###################################################################
177
177
178
178
# https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-diff3-Normal
179
179
diff3-normal :
180
- - match : ^ ====([1-3]?){{eol}}
180
+ - match : ' {{bol}} ====([1-3]?){{eol}}'
181
181
scope : meta.hunk.diff punctuation.section.hunk.diff
182
182
captures :
183
183
1 : constant.numeric.from-file.diff
184
184
185
- - match : ^ (([1-3])(:)(?:\d+(a)|\d+(?:(,)\d+)?(c))){{eol}}
185
+ - match : ' {{bol}} (([1-3])(:)(?:\d+(a)|\d+(?:(,)\d+)?(c))){{eol}}'
186
186
scope : meta.diff.range.normal meta.range.normal.diff
187
187
captures :
188
188
1 : meta.toc-list.hunk.diff
@@ -196,26 +196,26 @@ contexts:
196
196
diff3-normal-change :
197
197
- meta_scope : meta.hunk.diff
198
198
- meta_content_scope : meta.block.diff
199
- - match : ^ (?:\t| )
199
+ - match : ' {{bol}} (?:\t| )'
200
200
push : line-changed
201
- - match : ^
201
+ - match : ' {{bol}} '
202
202
pop : 1
203
203
204
204
# https://www.gnu.org/software/diffutils/manual/diffutils.html#Selecting-Which-Changes-to-Incorporate
205
205
diff3-edit :
206
- - match : ^ (\d+)(a){{eol}}
206
+ - match : ' {{bol}} (\d+)(a){{eol}}'
207
207
captures :
208
208
1 : meta.diff.range.normal meta.range.normal.diff
209
209
2 : support.function.diff
210
210
push : diff3-edit-inserted
211
211
212
- - match : ^ (\d+)(d){{eol}}
212
+ - match : ' {{bol}} (\d+)(d){{eol}}'
213
213
captures :
214
214
1 : meta.diff.range.normal meta.range.normal.diff
215
215
2 : support.function.diff
216
216
push : diff3-edit-deleted
217
217
218
- - match : ^ (\d+)(c){{eol}}
218
+ - match : ' {{bol}} (\d+)(c){{eol}}'
219
219
captures :
220
220
1 : meta.diff.range.normal meta.range.normal.diff
221
221
2 : support.function.diff
@@ -237,32 +237,32 @@ contexts:
237
237
- include : diff3-edit-end
238
238
239
239
diff3-edit-end :
240
- - match : ^ \.$
240
+ - match : ' {{bol}} \.$'
241
241
scope : punctuation.terminator.hunk.diff
242
242
pop : 1
243
243
244
244
# ##[ CONFLICTS ]###############################################################
245
245
246
246
# Utility context for other files to use
247
247
conflict-markers :
248
- - match : ^ ({{conflict_begin}})(?:\s*({{conflict_identifier}}))?{{eol}}
248
+ - match : ' {{bol}} ({{conflict_begin}})(?:\s*({{conflict_identifier}}))?{{eol}}'
249
249
scope : meta.block.conflict.begin.diff
250
250
captures :
251
251
1 : punctuation.section.block.begin.diff
252
252
2 : entity.name.section.diff
253
- - match : ^ ({{conflict_end}})(?:\s*({{conflict_identifier}}))?{{eol}}
253
+ - match : ' {{bol}} ({{conflict_end}})(?:\s*({{conflict_identifier}}))?{{eol}}'
254
254
scope : meta.block.conflict.end.diff
255
255
captures :
256
256
1 : punctuation.section.block.end.diff
257
257
2 : entity.name.section.diff
258
- - match : ^ ({{conflict_base}}|{{conflict_split}})(?:\s*({{conflict_identifier}}))?{{eol}}
258
+ - match : ' {{bol}} ({{conflict_base}}|{{conflict_split}})(?:\s*({{conflict_identifier}}))?{{eol}}'
259
259
scope : meta.block.conflict.separator.diff
260
260
captures :
261
261
1 : punctuation.section.block.diff
262
262
2 : entity.name.section.diff
263
263
264
264
conflicts :
265
- - match : ^\s* ({{conflict_begin}})(?:\s*({{conflict_identifier}}))?{{eol}}
265
+ - match : ' {{bol}} ({{conflict_begin}})(?:\s*({{conflict_identifier}}))?{{eol}}'
266
266
scope : meta.block.conflict.begin.diff
267
267
captures :
268
268
1 : punctuation.section.block.begin.diff
@@ -271,7 +271,7 @@ contexts:
271
271
272
272
conflict-deleted-lines :
273
273
- meta_content_scope : meta.block.conflict.diff markup.deleted.diff
274
- - match : ^\s* ({{conflict_base}})(?:\s*({{conflict_identifier}}))?{{eol}}
274
+ - match : ' {{bol}} ({{conflict_base}})(?:\s*({{conflict_identifier}}))?{{eol}}'
275
275
scope : meta.block.conflict.separator.diff
276
276
captures :
277
277
1 : punctuation.section.block.diff
@@ -281,7 +281,7 @@ contexts:
281
281
282
282
conflict-base-lines :
283
283
- meta_content_scope : meta.block.conflict.diff comment.block.diff
284
- - match : ^\s* ({{conflict_split}})(?:\s*({{conflict_identifier}}))?{{eol}}
284
+ - match : ' {{bol}} ({{conflict_split}})(?:\s*({{conflict_identifier}}))?{{eol}}'
285
285
scope : meta.block.conflict.separator.diff
286
286
captures :
287
287
1 : punctuation.section.block.diff
@@ -291,7 +291,7 @@ contexts:
291
291
292
292
conflict-new-lines :
293
293
- meta_content_scope : meta.block.conflict.diff markup.inserted.diff
294
- - match : ^\s* ({{conflict_end}})(?:\s*({{conflict_identifier}}))?{{eol}}
294
+ - match : ' {{bol}} ({{conflict_end}})(?:\s*({{conflict_identifier}}))?{{eol}}'
295
295
scope : meta.block.conflict.end.diff
296
296
captures :
297
297
1 : punctuation.section.block.end.diff
@@ -302,31 +302,31 @@ contexts:
302
302
- include : invalid-conflict-marker
303
303
304
304
invalid-conflict-marker :
305
- - match : ^ (?:{{conflict_any}})
305
+ - match : ' {{bol}} (?:{{conflict_any}})'
306
306
scope : invalid.illegal.conflict.diff
307
307
308
308
# ##[ SIDE-BY-SIDE ]############################################################
309
309
310
310
# https://www.gnu.org/software/diffutils/manual/diffutils.html#Side-by-Side
311
311
side-by-side :
312
- - match : ^ (.*) (<)$
312
+ - match : ' {{bol}} (.*) (<)$'
313
313
captures :
314
314
1 : markup.deleted.diff
315
315
2 : punctuation.definition.deleted.diff
316
- - match : ^ (.*) (\()$
316
+ - match : ' {{bol}} (.*) (\()$'
317
317
captures :
318
318
1 : comment.line.diff
319
319
2 : punctuation.definition.deleted.diff
320
- - match : ^ (.*) ([\\|/]) (.*)$
320
+ - match : ' {{bol}} (.*) ([\\|/]) (.*)$'
321
321
captures :
322
322
1 : markup.changed.diff
323
323
2 : punctuation.definition.changed.diff
324
324
3 : markup.changed.diff
325
- - match : ' ^ {4,}(>)(?: (.*))?$'
325
+ - match : ' {{bol}} {4,}(>)(?: (.*))?$'
326
326
captures :
327
327
1 : punctuation.definition.inserted.diff
328
328
2 : markup.inserted.diff
329
- - match : ' ^ {4,}(\))(?: (.*))?$'
329
+ - match : ' {{bol}} {4,}(\))(?: (.*))?$'
330
330
captures :
331
331
1 : punctuation.definition.inserted.diff
332
332
2 : comment.line.diff
0 commit comments