[TxMt] Re: Fixing YAML Inline Hash Syntax Highlighting

Jacob Coby jcoby at portallabs.com
Mon Dec 8 18:07:06 UTC 2008

Found a fix, along with a fix for comments at the end of lines not  
being highlighted correctly:

Index: Syntaxes/YAML.plist
--- Syntaxes/YAML.plist	(revision 10988)
+++ Syntaxes/YAML.plist	(working copy)
@@ -118,7 +118,7 @@
-			<string>(?:(?:(-\s*)?(\w+\s*(:)))|(-))\s*([A-Za-z0-9_].*)\s*$</ 
+			<string>(?:(?:(-\s*)?(\w+\s*(:)))|(-))\s*([^,{}&#]+)\s*</string>

Basically, I changed it from defining an unquoted string as "a leading  
word or digit or underscore followed by anything to the eol" to  
"anything that isn't in [,{}&#] and stop when you run out of chars"

It probably regresses some syntax highlighting, but nothing that I can  
obviously see or am concerned with.

On Dec 8, 2008, at 10:07 AM, Jacob Coby wrote:

> Hi all,
> Is it possible to fix the YAML inline-hash syntax highlighting?
> Working with Symfony, it's very common to have inline hashes in the
> routing.yml file.  They look something like:
> feed_enhanced:
>   url: /recently-added.xml
>   param: { module: feed, action: enhanced }
> The YAML bundle considers "feed, action: enhanced" to be a value for
> "module:" where "action:" should be a new key.
> Is there a fix?  I've briefly looked at fixing it, but I'm not
> familiar enough with the TM syntax definition to figure this out on my
> own.
> Thanks,
> --
> -Jacob
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate

Jacob Coby
Office: (336) 505-4320
jcoby at portallabs.com

More information about the textmate mailing list