Skip to content

Commit d1b6822

Browse files
committed
Fix the usage of \G because there is difference in how sublime uses it verses other editors
1 parent 9e2430a commit d1b6822

File tree

4 files changed

+34
-14
lines changed

4 files changed

+34
-14
lines changed

TypeScript.YAML-tmLanguage

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ repository:
511511
- include: '#method-declaration-name'
512512

513513
method-declaration-name:
514-
begin: \G
514+
begin: \G(?!\(|\<)
515515
end: (?=\(|\<)
516516
patterns:
517517
- match: (\*)\s*
@@ -1200,13 +1200,15 @@ repository:
12001200
- begin: (^[ \t]+)?(?=//)
12011201
beginCaptures:
12021202
'1': {name: punctuation.whitespace.comment.leading.ts}
1203-
end: (?!\G)
1203+
end: \n
1204+
endCaptures:
1205+
'0': { name: comment.line.double-slash.ts }
12041206
patterns:
12051207
- name: comment.line.double-slash.ts
12061208
begin: //
12071209
beginCaptures:
12081210
'0': {name: punctuation.definition.comment.ts}
1209-
end: \n
1211+
end: (?=\n)
12101212

12111213
docblock:
12121214
patterns:

TypeScript.tmLanguage

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,15 @@
614614
</dict>
615615
</dict>
616616
<key>end</key>
617-
<string>(?!\G)</string>
617+
<string>\n</string>
618+
<key>endCaptures</key>
619+
<dict>
620+
<key>0</key>
621+
<dict>
622+
<key>name</key>
623+
<string>comment.line.double-slash.ts</string>
624+
</dict>
625+
</dict>
618626
<key>patterns</key>
619627
<array>
620628
<dict>
@@ -629,7 +637,7 @@
629637
</dict>
630638
</dict>
631639
<key>end</key>
632-
<string>\n</string>
640+
<string>(?=\n)</string>
633641
<key>name</key>
634642
<string>comment.line.double-slash.ts</string>
635643
</dict>
@@ -2054,7 +2062,7 @@
20542062
<key>method-declaration-name</key>
20552063
<dict>
20562064
<key>begin</key>
2057-
<string>\G</string>
2065+
<string>\G(?!\(|\&lt;)</string>
20582066
<key>end</key>
20592067
<string>(?=\(|\&lt;)</string>
20602068
<key>patterns</key>

TypeScriptReact.YAML-tmLanguage

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ repository:
515515
- include: '#method-declaration-name'
516516

517517
method-declaration-name:
518-
begin: \G
518+
begin: \G(?!\(|\<)
519519
end: (?=\(|\<)
520520
patterns:
521521
- match: (\*)\s*
@@ -1189,13 +1189,15 @@ repository:
11891189
- begin: (^[ \t]+)?(?=//)
11901190
beginCaptures:
11911191
'1': {name: punctuation.whitespace.comment.leading.tsx}
1192-
end: (?!\G)
1192+
end: \n
1193+
endCaptures:
1194+
'0': { name: comment.line.double-slash.tsx }
11931195
patterns:
11941196
- name: comment.line.double-slash.tsx
11951197
begin: //
11961198
beginCaptures:
11971199
'0': {name: punctuation.definition.comment.tsx}
1198-
end: \n
1200+
end: (?=\n)
11991201

12001202
docblock:
12011203
patterns:
@@ -1415,7 +1417,7 @@ repository:
14151417
'3': { name: entity.name.tag.tsx }
14161418
'4': { name: punctuation.definition.tag.end.tsx }
14171419
patterns:
1418-
- begin: \G
1420+
- begin: \G(?![/]?>)
14191421
end: (?=[/]?>)
14201422
patterns:
14211423
- include: '#comment'

TypeScriptReact.tmLanguage

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,15 @@
582582
</dict>
583583
</dict>
584584
<key>end</key>
585-
<string>(?!\G)</string>
585+
<string>\n</string>
586+
<key>endCaptures</key>
587+
<dict>
588+
<key>0</key>
589+
<dict>
590+
<key>name</key>
591+
<string>comment.line.double-slash.tsx</string>
592+
</dict>
593+
</dict>
586594
<key>patterns</key>
587595
<array>
588596
<dict>
@@ -597,7 +605,7 @@
597605
</dict>
598606
</dict>
599607
<key>end</key>
600-
<string>\n</string>
608+
<string>(?=\n)</string>
601609
<key>name</key>
602610
<string>comment.line.double-slash.tsx</string>
603611
</dict>
@@ -2171,7 +2179,7 @@
21712179
<array>
21722180
<dict>
21732181
<key>begin</key>
2174-
<string>\G</string>
2182+
<string>\G(?![/]?&gt;)</string>
21752183
<key>end</key>
21762184
<string>(?=[/]?&gt;)</string>
21772185
<key>patterns</key>
@@ -2440,7 +2448,7 @@
24402448
<key>method-declaration-name</key>
24412449
<dict>
24422450
<key>begin</key>
2443-
<string>\G</string>
2451+
<string>\G(?!\(|\&lt;)</string>
24442452
<key>end</key>
24452453
<string>(?=\(|\&lt;)</string>
24462454
<key>patterns</key>

0 commit comments

Comments
 (0)