User forums > Using Code::Blocks
highlight/colorize embedded code
(1/1)
eaglecode:
Hi all!
I'm coding C/C++ with codeblocks for some years now, but with growing code I'am missing the possibility to highlight embedded code.
In this case I have embedded SQL strings in the code and for copy and paste reasons I have enclosed them into a MULTI_LINE_STRING() define.
--- Code: ---bool sqladapter::get_cars(session& sql)
{
sql << MULTI_LINE_SQL(
SELECT * FROM cars;
);
}
--- End code ---
My target is now to highlight everything between the brackets (the SQL code), maybe with a different background color or something similar.
I've seen and tested the scintilla highlight options, having matching brackets in every color I like, I have highlighted the "MULTI_LINE_SQL" keyword, but what about the part between the brackets ??? ?
Any ideas (or is it so simple, that I've missed it) ?
Thanks in advance!
BlueHazzard:
i am afraid, but i think without modifying the codeblocks source this won't be possible... Codeblocks uses the scintilla lexer interface so you can look at their site how to do tings.
oBFusCATed:
Your only option is to modify the c/c++ lexer in scintilla or you could probably implement a plugin that overrides the styling of parts of the text, but I'm not sure how it could be done. But for sure you'll need to write some custom code that modifies or extends codeblocks.
Navigation
[0] Message Index
Go to full version