Created
May 14, 2009 18:22
-
-
Save evaisse/111803 to your computer and use it in GitHub Desktop.
Recolourize Komodo edit syntax macro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A komodo edit 5 macro script for coloring javascript, php | |
and css inside html | |
*/ | |
try { | |
/** | |
* @type {Components.interfaces.ISciMoz} | |
*/ | |
var v = ko.views.manager.currentView; | |
var lang = v.document.language; | |
/* | |
set your color scheme here | |
*/ | |
var backgroundColors = { | |
html: 0xFFFFFF, | |
css: 0xDDEEDD, | |
js: 0xDDDDEE, | |
php: 0xEEEEEE | |
} | |
if( lang == 'PHP') { | |
// HTML background | |
v.scimoz.styleSetEOLFilled(0, true); | |
for (var i=0; i<1000; i++) { | |
v.scimoz.styleSetBack( i, backgroundColors.php); | |
} | |
for (var i=0; i<15; i++) { | |
v.scimoz.styleSetBack( i, backgroundColors.html); | |
} | |
// CSS background | |
v.scimoz.styleSetEOLFilled( 15, true ); | |
for (var i=15; i<22; i++) { | |
v.scimoz.styleSetBack( i, backgroundColors.css ); | |
} | |
// Javascript background | |
v.scimoz.styleSetEOLFilled(22, true); | |
for (var i=22; i<31; i++) { | |
v.scimoz.styleSetBack( i, backgroundColors.js ); | |
} | |
} | |
// reload syntax highlighting | |
v.scimoz.colourise(0, -1); | |
} catch(ex) { | |
alert("Exception: " + ex ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment