Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improve comment.line match.

  • Loading branch information...
commit 5d79ef5b825ee832932c42285712f42a2c042741 1 parent 8cf93e2
@infininight infininight authored
Showing with 50 additions and 12 deletions.
  1. +50 −12 Syntaxes/Thrift.tmLanguage
View
62 Syntaxes/Thrift.tmLanguage
@@ -688,32 +688,70 @@
<key>patterns</key>
<array>
<dict>
- <key>captures</key>
+ <key>begin</key>
+ <string>(^[ \t]+)?(?=#)</string>
+ <key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
- <string>punctuation.definition.comment.thrift</string>
+ <string>punctuation.whitespace.comment.leading.thrift</string>
</dict>
</dict>
- <key>match</key>
- <string>(#).*\n?</string>
- <key>name</key>
- <string>comment.line.number-sign.thrift</string>
+ <key>end</key>
+ <string>(?!\G)</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>begin</key>
+ <string>#</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.thrift</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
+ <key>name</key>
+ <string>comment.line.number-sign.thrift</string>
+ </dict>
+ </array>
</dict>
<dict>
- <key>captures</key>
+ <key>begin</key>
+ <string>(^[ \t]+)?(?=//)</string>
+ <key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
- <string>punctuation.definition.comment.thrift</string>
+ <string>punctuation.whitespace.comment.leading.thrift</string>
</dict>
</dict>
- <key>match</key>
- <string>(//).*\n?</string>
- <key>name</key>
- <string>comment.line.double-slash.thrift</string>
+ <key>end</key>
+ <string>(?!\G)</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>begin</key>
+ <string>//</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.thrift</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
+ <key>name</key>
+ <string>comment.line.double-slash.thrift</string>
+ </dict>
+ </array>
</dict>
<dict>
<key>begin</key>
Please sign in to comment.
Something went wrong with that request. Please try again.