[TxMt] Re: Possible to add on to language instead of "overwrite"?

Martin Kühl martin.kuehl at gmail.com
Wed Sep 22 19:35:19 UTC 2010


On Wed, Sep 22, 2010 at 20:55, minimal design
<textmate at minimaldesign.net> wrote:
> I've looked through the docs but can't figure it out...
> I'm trying to add CSS3 stuff to the default CSS bundle, but I don't want to
> touch the original bundle off course so in my own bundle I try something
> like:
>
> { scopeName = 'source.css.mcss'; fileTypes = ( 'css', 'css.erb', 'less');
> foldingStartMarker = '/\*\*(?!\*)|\{\s*($|/\*(?!.*?\*/.*\S))';
> foldingStopMarker = '(?<!\*)\*\*/|^\s*\}'; patterns = ( { name =
> 'meta.selector.css'; begin = '^(?=\s*[:.*#a-zA-Z])'; end = '(?=\{)';
> patterns = ( { name = 'entity.name.tag.css'; match =
> '\b(article|aside|audio|canvas|command|datalist|details|embed|figcaption|figure|footer|header|hgroup|keygen
> |mark|menu|meter|nav|output|progress|rp|rt|ruby|section|summary|time|video|wbr)\b';
> }, ); }, { include = "source.css"; } ); }
> and I get all the new elements highlighted like they're supposed to, but
> that "cancels out" the standard CSS elements. I thought adding the
> "source.css" would take care of that but obviously it doesn't... Do I have
> to include the standard elements back into the regex? Is there a better way?
> Thanks for any pointer in the right direction!

Not sure if it'll work but you could try adding your pattern after including
`source.css`, i.e.
    patterns = ( { include = "source.css"; }, … );

HTH,
Martin



More information about the textmate mailing list