Diff of /syntax/diff.jsf.in [000000] .. [409b67]  Maximize  Restore

Switch to unified view

a b/syntax/diff.jsf.in
1
# JOE syntax highlight file for diff/patch files
2
#
3
# 2007-05-11 :
4
#
5
# This file is just udiff.jsf, ndiff.jsf and cdiff.jsf merged together
6
# into one file, to handle cases where A) it's difficult to tell what
7
# type of diff might be inside the file to highlight and B) the file to
8
# highlight may contain hunks of different types of diffs (unlikely).
9
# Of course it can be used to replace the 3 abovementioned files
10
# completely. If you want that, you need to edit ftyperc accordingly.
11
#
12
#   Dirk Schenkewitz <Dirk.Schenkewitz (AT) gmx.de>
13
#
14
15
16
# Color definitions
17
=Idle
18
=Garbage  dim white
19
=DiffCmd  blue
20
=FileOld  bold red
21
=FileNew  bold green
22
=HunkHead bold blue
23
=HunkMid  bold blue
24
=DelLine  red
25
=AddLine  green
26
=ChgLine  magenta
27
=CtxLine
28
29
30
:reset Idle
31
  *       garbage     recolor=-1
32
  "\n"        reset
33
  "d"     garbage     buffer  recolor=-1 # may be a "diff" command
34
  "-"     udiff_o1               # may start a unified diff hunk
35
  "*"     cdiff_o1               # may start a context diff hunk
36
  "0-9"       ndiff_r0    mark    recolor=-1 # may start a "normal" diff hunk
37
38
:garbage Garbage
39
  *       garbage     strings
40
  "diff"      diff_cmd    recolor=-3
41
done
42
  "\n"        reset
43
44
:diff_cmd DiffCmd
45
  *       diff_cmd
46
  "\n"        reset
47
48
#----------------------------------------------
49
50
# unified diffs:
51
52
:udiff_o1 Idle
53
  *       garbage     recolor=-2  buffer
54
  "-"     udiff_o2
55
56
:udiff_o2 Idle
57
  *       garbage     recolor=-3  buffer
58
  "-"     udiff_o3    
59
60
:udiff_o3 Idle
61
  *       garbage     recolor=-4  buffer
62
  " "     udiff_o4
63
64
:udiff_o4 Idle
65
  *       udiff_oldf  recolor=-5
66
  " "     garbage     recolor=-5  buffer
67
68
:udiff_n0 Idle
69
  *       garbage     recolor=-1  buffer
70
  "+"     udiff_n1
71
72
:udiff_n1 Idle
73
  *       garbage     recolor=-2  buffer
74
  "+"     udiff_n2
75
76
:udiff_n2 Idle
77
  *       garbage     recolor=-3  buffer
78
  "+"     udiff_n3    
79
80
:udiff_n3 Idle
81
  *       garbage     recolor=-4  buffer
82
  " "     udiff_newf  recolor=-4
83
84
:udiff_oldf FileOld
85
  *       udiff_oldf
86
  "\n"        udiff_n0
87
88
:udiff_newf FileNew
89
  *       udiff_newf
90
  "\n"        udiff_prehunk1
91
92
:udiff_prehunk1 Idle
93
  *       garbage
94
  "@"     udiff_prehunk2
95
  "\n"        reset
96
97
:udiff_prehunk2 Idle
98
  *       garbage     recolor=-1
99
  "@"     udiff_prehunk3
100
  "\n"        reset
101
102
:udiff_prehunk3 Idle
103
  *       garbage     recolor=-1
104
  " "     udiff_hunkhead  recolor=-3
105
  "\n"        reset
106
107
:udiff_hunkhead HunkHead
108
  *       udiff_hunkhead
109
  "\n"        udiff_hunkbody
110
111
:udiff_hunkbody Idle
112
  *       reset       noeat
113
  "d"     garbage     recolor=-1  buffer
114
  "-"     udiff_minus1
115
  "+"     udiff_add   recolor=-1
116
  " "     udiff_ctx   recolor=-1
117
  "@"     udiff_prehunk2
118
119
:udiff_minus1 Idle
120
  *       udiff_del   noeat recolor=-2
121
  "-"     udiff_minus2
122
123
:udiff_minus2 Idle
124
  *       udiff_del   noeat recolor=-3
125
  "-"     udiff_minus3
126
127
:udiff_minus3 Idle
128
  *       udiff_del   noeat recolor=-4
129
  " "     udiff_minus4
130
131
:udiff_minus4 Idle
132
  *       udiff_oldf  recolor=-5
133
  "\n"        udiff_hunkbody
134
  " "     udiff_del   recolor=-5
135
136
:udiff_del DelLine
137
  *       udiff_del
138
  "\n"        udiff_hunkbody
139
140
:udiff_add AddLine
141
  *       udiff_add
142
  "\n"        udiff_hunkbody
143
144
:udiff_ctx CtxLine
145
  *       udiff_ctx
146
  "\n"        udiff_hunkbody
147
148
#----------------------------------------------
149
150
# "normal" diffs:
151
152
:ndiff_r0 Idle
153
  *       garbage noeat   recolormark
154
  "0-9"       ndiff_r0
155
  ","     ndiff_r1
156
  "adc"       ndiff_r2
157
  "\n"        reset   markend
158
159
:ndiff_r1 Idle
160
  *       garbage recolormark
161
  "0-9"       ndiff_r1
162
  "adc"       ndiff_r2
163
  "\n"        reset   markend
164
165
:ndiff_r2 Idle
166
  *       garbage noeat recolormark
167
  "0-9"       ndiff_r2
168
  ","     ndiff_r3
169
  "\n"        ndiff_re noeat recolormark
170
171
:ndiff_r3 Idle
172
  *       garbage noeat recolormark
173
  "0-9"       ndiff_r3
174
  "\n"        ndiff_re noeat recolormark
175
176
:ndiff_re HunkHead
177
  "\n"        ndiff_hunk0
178
179
:ndiff_hunk0 HunkHead
180
  *       reset noeat
181
  "<"     ndiff_o1
182
  ">"     ndiff_n1
183
  "\\"        ndiff_t1
184
185
186
:ndiff_hunk1 HunkHead
187
  *       reset noeat
188
  "<"     ndiff_o1
189
  ">"     ndiff_n1
190
  "-"     ndiff_m1    recolor=-1
191
  "\\"        ndiff_t1
192
193
194
:ndiff_t1 Idle
195
  *       garbage     recolor=-3
196
  "\n"        reset
197
  " "     ndiff_txt   recolor=-3
198
199
:ndiff_o1 Idle
200
  *       garbage     recolor=-3
201
  "\n"        reset
202
  " "     ndiff_del   recolor=-3
203
204
:ndiff_n1 Idle
205
  *       garbage     recolor=-3
206
  "\n"        reset
207
  " "     ndiff_add   recolor=-3
208
209
:ndiff_txt CtxLine
210
  *       ndiff_txt
211
  "\n"        ndiff_hunk1
212
213
:ndiff_del DelLine
214
  *       ndiff_del
215
  "\n"        ndiff_hunk1
216
217
:ndiff_add AddLine
218
  *       ndiff_add
219
  "\n"        ndiff_hunk1
220
221
222
:ndiff_m1 Idle
223
  *       garbage     recolor=-2
224
  "-"     ndiff_m2
225
  "\n"        reset       recolor=-2
226
227
:ndiff_m2 Idle
228
  *       garbage     recolor=-3
229
  "-"     ndiff_m3    recolor=-3
230
231
:ndiff_m3 HunkMid
232
  *       garbage     recolor=-4
233
  "\n"        ndiff_hunk0
234
235
#----------------------------------------------
236
237
# context diffs:
238
239
:cdiff_o1 Idle
240
  *       garbage     recolor=-2  buffer
241
  "*"     cdiff_o2
242
243
:cdiff_o2 Idle
244
  *       garbage     recolor=-3  buffer
245
  "*"     cdiff_o3    
246
247
:cdiff_o3 Idle
248
  *       garbage     recolor=-4  buffer
249
  " "     cdiff_o4
250
251
:cdiff_o4 Idle
252
  *       cdiff_oldf  recolor=-5
253
  " "     garbage     recolor=-5  buffer
254
255
:cdiff_oldf FileOld
256
  *       cdiff_oldf
257
  "\n"        cdiff_n0
258
259
:cdiff_n0 Idle
260
  *       garbage     recolor=-1  buffer
261
  "-"     cdiff_n1
262
263
:cdiff_n1 Idle
264
  *       garbage     recolor=-2  buffer
265
  "-"     cdiff_n2
266
267
:cdiff_n2 Idle
268
  *       garbage     recolor=-3  buffer
269
  "-"     cdiff_n3    
270
271
:cdiff_n3 Idle
272
  *       garbage     recolor=-4  buffer
273
  " "     cdiff_newf  recolor=-4
274
275
:cdiff_newf FileNew
276
  *       cdiff_newf
277
  "\n"        cdiff_prehunk0
278
279
:cdiff_prehunk0 Idle
280
  *       manystars   buffer
281
282
:manystars Idle
283
  *       garbage     noeat strings
284
  "***************" cdiff_prehunk1
285
done
286
  "*"     manystars
287
288
289
:cdiff_prehunk1 HunkHead
290
  *       cdiff_ho0
291
292
:cdiff_ho0 Idle
293
  *       garbage     recolor=-1  buffer
294
  "*"     cdiff_ho1
295
296
:cdiff_ho1 Idle
297
  *       garbage     recolor=-2  buffer
298
  "*"     cdiff_ho2
299
300
:cdiff_ho2 Idle
301
  *       garbage     recolor=-3  buffer
302
  "*"     cdiff_ho3   
303
304
:cdiff_ho3 Idle
305
  *       garbage     recolor=-4  buffer
306
  " "     cdiff_ho4   recolor=-4  mark
307
308
:cdiff_ho4 HunkHead
309
  *       garbage     recolormark buffer
310
  "0-9,"      cdiff_ho4
311
  " "     cdiff_ho5   recolormark buffer
312
  "\n"        reset   markend
313
314
:cdiff_ho5 HunkHead
315
  *       garbage     recolor=-1  buffer
316
  "*"     cdiff_ho6
317
318
:cdiff_ho6 Idle
319
  *       garbage     recolor=-2  buffer
320
  "*"     cdiff_ho7
321
322
:cdiff_ho7 Idle
323
  *       garbage     recolor=-3  buffer
324
  "*"     cdiff_ho8   
325
326
:cdiff_ho8 Idle
327
  *       garbage     recolor=-4  buffer
328
  "*"     cdiff_ho9   recolor=-4
329
330
:cdiff_ho9 HunkHead
331
  *       garbage     recolor=-5  buffer
332
  "\n"        cdiff_hunk
333
334
335
:cdiff_hn0 Idle
336
  *       garbage     recolor=-1  buffer
337
  "-"     cdiff_hn1
338
339
:cdiff_hn1 Idle
340
  *       garbage     recolor=-2  buffer
341
  "-"     cdiff_hn2
342
343
:cdiff_hn2 Idle
344
  *       garbage     recolor=-3  buffer
345
  "-"     cdiff_hn3   
346
347
:cdiff_hn3 Idle
348
  *       garbage     recolor=-4  buffer
349
  " "     cdiff_hn4   recolor=-4  mark
350
351
:cdiff_hn4 HunkHead
352
  *       garbage     recolormark buffer
353
  "0-9,"      cdiff_hn4
354
  " "     cdiff_hn5   recolormark buffer
355
  "\n"        reset   markend
356
357
:cdiff_hn5 HunkHead
358
  *       garbage     recolor=-1  buffer
359
  "-"     cdiff_hn6
360
361
:cdiff_hn6 Idle
362
  *       garbage     recolor=-2  buffer
363
  "-"     cdiff_hn7
364
365
:cdiff_hn7 Idle
366
  *       garbage     recolor=-3  buffer
367
  "-"     cdiff_hn8   
368
369
:cdiff_hn8 Idle
370
  *       garbage     recolor=-4  buffer
371
  "-"     cdiff_hn9   recolor=-4
372
373
:cdiff_hn9 HunkHead
374
  *       garbage     recolor=-5  buffer
375
  "\n"        cdiff_hunk
376
377
378
379
:cdiff_hunk Idle
380
  *       garbage     recolor=-1  buffer
381
  " "     cdiff_h_c0
382
  "+"     cdiff_h_p0
383
  "!"     cdiff_h_x0
384
  "-"     cdiff_h_m0
385
  "*"     manystars   buffer
386
387
:cdiff_h_c0 Idle
388
  *       garbage     recolor=-2  buffer
389
  " "     cdiff_h_c1  recolor=-2
390
  "\n"        reset
391
392
:cdiff_h_c1 CtxLine
393
  *       cdiff_h_c1
394
  "\n"        cdiff_hunk
395
396
:cdiff_h_p0 Idle
397
  *       garbage     recolor=-2  buffer
398
  " "     cdiff_h_p1  recolor=-2
399
  "\n"        reset
400
401
:cdiff_h_p1 AddLine
402
  *       cdiff_h_p1
403
  "\n"        cdiff_hunk
404
405
:cdiff_h_x0 Idle
406
  *       garbage     recolor=-2  buffer
407
  " "     cdiff_h_x1  recolor=-2
408
  "\n"        reset
409
410
:cdiff_h_x1 ChgLine
411
  *       cdiff_h_x1
412
  "\n"        cdiff_hunk
413
414
:cdiff_h_m0 Idle
415
  *       garbage     recolor=-2  buffer
416
  " "     cdiff_h_m1  recolor=-2
417
  "-"     cdiff_hn2   recolor=-2
418
  "\n"        reset
419
420
:cdiff_h_m1 DelLine
421
  *       cdiff_h_m1
422
  "\n"        cdiff_hunk