[TxMt] Intelligent boolean highlights

james at vennt.net james at vennt.net
Thu Oct 26 10:15:03 UTC 2006


I modded my Textmate Javascript bundle today to treat 'true' and 'false'
different to the other constants.
http://vennt.net/tempting/intelibool.png
So now true gets a green highlight and false a red one so you can read if
statements at a glance etc

Here are the lines I modified

		{	name = 'constant.language.js';
			match = '\b(false|null|super|this|true)\b';
		},
was replaced with

		{	name = 'constant.language.js';
			match = '\b(null|super|this)\b';
		},
		{	name = 'constant.language.js.true';
			match = '\b(true)\b';
		},
		{	name = 'constant.language.js.false';
			match = '\b(false)\b';
		},

Then I just added rules to my current theme for
"constant.language.js.true" and "constant.language.js.false"

I would have done it Textmate wide but I don't know enough about the
system for that, is there any implications for what I have done here?




More information about the textmate mailing list