[TxMt] bug in smarty module

Allan Odgaard throw-away-1 at macromates.com
Sun Oct 22 09:15:21 UTC 2006


On 22. Oct 2006, at 08:11, Rick Gigger wrote:

> It seems to me that there is a bug in the smarty bundle.  Any time  
> you have a ' in a comment or as an apostrophe in text (as in don't)  
> it thinks it's the start of a string and throws off the hilighting  
> for the rest of the page.

The Smarty bundle itself contains only a grammar to be embedded in  
HTML, not a root-level-grammar.

So you should still use HTML as the language, but you need to make  
one edit to the HTML grammar to activate the Smarty blocks.

Unfortunately the image links are broken here [1], so locate this  
rule in the HTML grammar:

     smarty = { patterns = (
             {   begin = '(\{(literal)\})';
                 end = '(\{/(literal)\})';
                 captures =
                 {   1 = { name = 'source.smarty.embedded.html'; };
                     2 = { name = 'support.function.built-in.smarty'; };
                 };
             },
             {   name = 'source.smarty.embedded.html';
                 begin = '{{|{';
                 end = '}}|}';
                 patterns = ( { include = 'source.smarty'; } );
                 disabled = 1;
             },
         );
     };

Then change that last disabled to ‘= 0’ or remove it.


[1] http://clickablebliss.com/blog/2006/01/04/ 
teach_textmate_about_smarty/


More information about the textmate mailing list