Open willeccles opened 3 years ago
Other thoughts: some of these issues could be avoided by simply doing a brute force highlighting of everything inside the [[]]
to make it all the same color, but I didn't like that solution.
G'day,
Just some quick thoughts...
cppAttribute
to the cPreProcGroup
cluster which is excluded from cDefine
should fix the #define
highlighting. This can be done from within cpp.vim with syn cluster cPreProcGroup add=cppAttribute
[noreturn]
is matched as cBracket
and likewise you could try adding cppAttribute
to the excluded cParenGroup
clusterI'm not really familiar with the C syntax file but if that doesn't get you started I can take a deeper look.
Regards, Doug
I have for the time being implemented this in my own local copy (in ~/.vim/syntax). I am not an expert at vim syntax files, so I have one minor problem which is that if you have
[noreturn]
, thenoreturn
will be highlighted (and some other weird edge cases), but I'm not able to fix this myself, so I've simply attached attached my diff so far:I have made an effort to not highlight attributes outside of valid contexts (e.g.
likely
is not highlighted unless it's inside an attribute specifier), but it seems to have some unfortunate side effects. At the moment, this is the resulting highlighting in a few cases: