Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: pmichal on April 20, 2022, 11:10:29 pm

Title: Editor: syntax highlighting - defining custom comments or non-highlighed lines
Post by: pmichal on April 20, 2022, 11:10:29 pm
Hello everyone - this is my first post.

I have a question that I couldn't find an answer to in the forum:

In the Code::Blocks editor, is it possible to define an entire line highlight if it starts with a user-defined keyword?
The end result would look like a comment but with custom word(s) defining the start of the 'comment'.
For example, I would like the line below to be colored as a comment, instead of recognizing (and coloring separately) numbers, strings, variable names, etc. Of course, the compiler will still recognize c / c ++ keywords and compile correctly.
I just wish some of my code was not highlighed.

Code
MY_KEYWORD (2,"string here " + function(variable));

Greetings
Title: Re: Editor: syntax highlighting - defining custom comments or non-highlighed lines
Post by: BlueHazzard on April 21, 2022, 09:25:47 am
You would have to write your own lexer...

This is currently not supported
Title: Re: Editor: syntax highlighting - defining custom comments or non-highlighed lines
Post by: pmichal on April 21, 2022, 02:24:53 pm
Ok, thank you for your answer.