I’m trying to extend some CSS highlighting in Textmate. My approach is like so…
{
....
patterns = (
{ include = 'source.css'; },
{
name = 'support.function';
match = '\..*\);';
},
);
}
The problem is “include = ‘source.css’;”. If I remove that line. My custom matcher hits and applies the expected highlighting. But then I lose all the predefined css highlighting that I want.
I’m puzzled as to how I can override the existing css highlighting that I am including. Ideas?
I had a similar issue. I banged my head against it, then someone in the TextMate IRC channel set me straight: for some reason (which I forget) you need to reinclude your language grammer.
My patterns section now looks like
To add more information to this example, here is my language grammer for the bundle I was creating (in the part of the file I was interested in, everything was in the scope meta.rails.model. Maybe you don’t have that in your CSS bundle.
}
But you see that the $self declaration pulls in the other patterns into the meta.rails.model pattern (which is, I think, why that was important).