[TxMt] bug in smarty module

Rick Gigger rick at alpinenetworking.com
Thu Oct 26 22:22:17 UTC 2006


Allan Odgaard wrote:
> 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.

Thanks!  That worked great!  Is there any reason it's disabled by 
default?  Any plans to make that sort of thing more user friendly in the 
future?



More information about the textmate mailing list