Permalink
Browse files

adding javascript filter context so syntax highlighting partially works

  • Loading branch information...
Samuel Cochran
Samuel Cochran committed Oct 8, 2010
1 parent 51abee0 commit 09e1e7a240a0f8e79ce349f7e255712fc25d0a7e
Showing with 48 additions and 1 deletion.
  1. +48 −1 Syntaxes/Ruby Haml.tmLanguage
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
@@ -68,6 +68,53 @@
</dict>
</array>
</dict>
+ <dict>
+ <key>begin</key>
+ <string>^( *)(:)(?i:javascript)</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.filter.haml</string>
+ </dict>
+ <key>3</key>
+ <dict>
+ <key>name</key>
+ <string>meta.filter.haml</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>^(?!\1 )</string>
+ <key>name</key>
+ <string>source.js.embedded.haml</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>source.js</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>source.js.jquery</string>
+ </dict>
+ <dict>
+ <key>begin</key>
+ <string>#{</string>
+ <key>end</key>
+ <string>}</string>
+ <key>name</key>
+ <string>source.ruby.rails.embedded.haml</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#interpolated_ruby</string>
+ </dict>
+ </array>
+ </dict>
+ </array>
+ </dict>
<dict>
<key>begin</key>
<string>^\s*(?:((%)([\w:]+))|(?=\.|#))</string>

0 comments on commit 09e1e7a

Please sign in to comment.