Textmate syntax highlighting, extension of highlighting from another language

I am trying to expand CSS highlighting in Textmate. My approach looks like this ...

{ 
    ....
    patterns = (
        { include = 'source.css'; },
        { 
            name = 'support.function';
            match = '\..*\);';
        },
    );
}

The problem is include = 'source.css'; ". If I delete this line. My user will match and apply the expected highlight. But then I lose all the predefined css highlighting what I want.

I am puzzled by how I can override the existing css selection that I include. Ideas?

+5
source share
1 answer

. , - IRC- TextMate : - ( ) .

patterns = (
{   include = 'source.ruby'; },
{   include = '$self'; },
);

, ( , , meta.rails.model. , CSS.

patterns = (
    {   name = 'meta.rails.model';
        comment = "Uses lookahead to match classes that (may) inherit from ActiveRecord::Base; includes 'source.ruby' to avoid infinite recursion";
        begin = '(^\s*)(?=class\s+.+ActiveRecord::Base)';
        end = '^\1(?=end)\b';
        patterns = (
            {   include = 'source.ruby'; },
            {   include = '$self'; },
        );
    },
    {   name = 'source.ruby.rails.aasm.event';
        match = '(aasm_event\W*:\w+)';
        captures = { 1 = { name = 'keyword.other.context.ruby.rails.aasm.event'; }; };
    },
    {   include = 'source.ruby.rails'; },
);

}

, $self meta.rails.model(, , ).

+4

All Articles