On Thu, Sep 23, 2010 at 8:00 AM, textmate-request@lists.macromates.comwrote:
On Wed, Sep 22, 2010 at 20:55, minimal design textmate@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
It seems that whatever I put last, it cancels the other one out... From the DOc, I though that it would inherit if you use the name convention... But the inheritance doesn't happen within patterns that have the same name? Is that what the deal is? Or I"m doing it wrong? It seems counterproductive not to be able to ad on to a rule, so I tend to think I'm doing it wrong, but I've tried all the option I could think about... Anyone has done this before? If I have to just have to duplicate and modify the whole default CSS language, that's fine, but I want to make sure there's no better way first... Thanks!!