[TxMt] syntax highlighting C++ a bit broken

Michael Rogers m.rogers at hef.ru.nl
Wed Feb 11 15:14:37 UTC 2009


TextMate just updated itself, now at version 1.5.8. Suddenly, the C++  
highlighting is slightly broken. Example:

#include <stdio.h>
#include <stdlib.h>
#include "vector/Cartesian3Vector.h"
#define C3V Cartesian3Vector
#define PI acos(-1.0)


int main(int argc, char *argv[])
{
     vector<Track> * tracks;
     McGossip mcg;
     double z0;
	<more code...>
}

gives weird wrong highlighting. But if you add a semi-colon in a  
strategic place, everything is fine again.

#include <stdio.h>
#include <stdlib.h>
#include "vector/Cartesian3Vector.h"

#define C3V Cartesian3Vector
#define PI acos(-1.0);					// Added semi-colon, but you don't want  
this in real code


int main(int argc, char *argv[])
{
     vector<Track> * tracks;
     McGossip mcg;
     double z0;
	<more code...>
}

Or if you move the #define ending with a parenthesis up one line it's  
happy again:

#include <stdio.h>
#include <stdlib.h>
#include "vector/Cartesian3Vector.h"
#define PI acos(-1.0)
#define C3V Cartesian3Vector


int main(int argc, char *argv[])
{
     vector<Track> * tracks;
     McGossip mcg;
     double z0;
	<more code...>
}

So I guess the line ending in closed paren is throwing it off. It  
didn't do this before the update.




More information about the textmate mailing list