forked from timbrel/GitSavvy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.sublime-syntax
114 lines (98 loc) · 3.16 KB
/
graph.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: GitSavvy Graph
file_extensions: []
hidden: true
scope: git-savvy.graph
variables:
sha: '[0-9a-f]{6,40}'
contexts:
main:
- match: (?=^.*{{sha}} +\(HEAD( ->|\)))
push:
- meta_scope: meta.graph.graph-line.head.git-savvy
- include: content
- match: $
pop: true
- include: content
content:
- match: '([| \\/_.-]+)'
comment: graph lines
scope: punctuation.other.git-savvy.graph.graph-line
- match: '[*●]'
scope: keyword.graph.commit.git-savvy
- match: \s*({{sha}})\b
comment: SHA
scope: constant.numeric.graph.commit-hash.git-savvy
- include: branch-name
- match: (?=\S)
push: message
branch-name:
- match: \s*\(
comment: branch-name
scope: punctuation.expression.begin.git-savvy
push:
- meta_scope: meta.graph.branch.git-savvy
- match: \)
scope: punctuation.expression.end.git-savvy
pop: true
- match: (tag)(:) ([^ ,)]+)
scope: meta.graph.tag.git-savvy
captures:
1: storage.type.git-savvy.graph
2: punctuation.separator.other.git-savvy
3: entity.name.tag.branch-name.git-savvy
- match: ','
scope: punctuation.separator.other.git-savvy
- match: '->'
scope: punctuation.separator.key-value.branch.git-savvy
- match: HEAD
scope: constant.other.git.head.git-savvy
- match: ([^ ,)]+)
scope: constant.other.git.branch.git-savvy
message:
- meta_scope: meta.graph.message.git-savvy
- match: (`[^`]*`)
comment: by name
scope: keyword.by-name.git-savvy.
- match: '(?:[Ff]ix(?:e[ds])?|[Rr]esolve[ds]?|[Cc]lose[ds]?)?\s*(?:#\d+|\[.*?\])'
comment: issue numbers
scope: string.other.issue.git-savvy
- match: Merge branch (')(.*?)(')\s*(?:(?:of|into)\s+(\S*))?
comment: merges
scope: meta.git-savvy.grph.merge
captures:
1: punctuation.string.begin.git-savvy
2: string.other.merge.branch-name.git-savvy
3: punctuation.string.end.git-savvy
4: string.other.merge.remote.git-savvy
- match: Merge branches\b
comment: merges
scope: meta.git-savvy.grph.merge
push:
- match: (')(.*?)(')(?:,| and)?
captures:
1: punctuation.string.begin.git-savvy
2: string.other.merge.branch-name.git-savvy
3: punctuation.string.end.git-savvy
- match: (?:of|into)\s+(\S*)
captures:
1: string.other.merge.remote.git-savvy
- match: (?=\S)
pop: true
- match: Merge pull request (#\d+) from (\S*)
scope: meta.git-savvy.grph.merge
captures:
0: meta.git-savvy.grph.merge.pull-request
1: string.other.issue.git-savvy
2: string.other.merge.remote.git-savvy
- match: ':'
scope: punctuation.separator.key-value.git-savvy
- match: (\([^)]*?\)) (<[^>]*?>)(?=$)
scope: meta.git-savvy.grph.info
captures:
1: storage.type.time.git-savvy
2: entity.name.tag.author.git-savvy
- match: $
pop: true