[TxMt] Better JavaScript functions

Allan Odgaard throw-away-1 at macromates.com
Sun Oct 9 14:23:55 UTC 2005


On 09/10/2005, at 16.11, Gavin Kistner wrote:

> [...] if *I* were writing the syntax highlighting regexp, I think  
> I'd be lazy and simply do:

Thanks, so I'll be committing this patch:

Index: JavaScript.plist
===================================================================
--- JavaScript.plist (revision 1895)
+++ JavaScript.plist (working copy)
@@ -39,7 +39,7 @@
             </dict>
          </dict>
          <key>match</key>
-        <string>^\s*(function)\s+([a-zA-Z_]\w*)\s*\(([^)]*)\)</string>
+        <string>\b(function)(\s+[a-zA-Z_]\w*)?\s*\((.*?)\)</string>
          <key>name</key>
          <string>meta.function.js</string>
       </dict>




More information about the textmate mailing list