Permalink
Browse files

Improve comment.line match.

  • Loading branch information...
1 parent c094f4c commit dad0d8472aad14771aa2e648b8045db95a3c6cd0 @infininight infininight committed Nov 21, 2011
Showing with 50 additions and 11 deletions.
  1. +50 −11 Syntaxes/SSH-Config.tmLanguage
@@ -19,31 +19,70 @@
<string>keyword.other.ssh-config</string>
</dict>
<dict>
- <key>captures</key>
+ <key>begin</key>
+ <string>(^[ \t]+)?(?=#)</string>
+ <key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
- <string>comment.line.number-sign.ssh-config</string>
+ <string>punctuation.whitespace.comment.leading.ssh-config</string>
</dict>
- <key>2</key>
+ </dict>
+ <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.ssh-config</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
<key>name</key>
- <string>punctuation.definition.comment.ssh-config</string>
+ <string>comment.line.number-sign.ssh-config</string>
</dict>
- <key>3</key>
+ </array>
+ </dict>
+ <dict>
+ <key>begin</key>
+ <string>(^[ \t]+)?(?=//)</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>1</key>
<dict>
<key>name</key>
- <string>comment.line.double-slash.ssh-config</string>
+ <string>punctuation.whitespace.comment.leading.ssh-config</string>
</dict>
- <key>4</key>
+ </dict>
+ <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.ssh-config</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
<key>name</key>
- <string>punctuation.definition.comment.ssh-config</string>
+ <string>comment.line.double-slash.ssh-config</string>
</dict>
- </dict>
- <key>match</key>
- <string>((#).*$\n?)|((//).*$\n?)</string>
+ </array>
</dict>
<dict>
<key>captures</key>

0 comments on commit dad0d84

Please sign in to comment.