News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

syntax highlighting in C/C++

Started by pomelo, August 30, 2011, 10:51:46 AM

Previous topic - Next topic

pomelo

hi,

I want to know if there is any way to set special colors to functions, macro definitions, and typedefed types in C/C++.

thanks in advance.

MortenMacFly

Quote from: pomelo on August 30, 2011, 10:51:46 AM
I want to know if there is any way to set special colors to functions, macro definitions, and typedefed types in C/C++.
Inspect the lexer settings for the language of your choice in the editor options.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

pomelo

Quote from: MortenMacFly on August 31, 2011, 08:43:06 AM
Inspect the lexer settings for the language of your choice in the editor options.
In Syntax Highlighting settings' panel there is a predefined highlighting mode for C/C++, but the predefined mode does not handle colors for functions, macro definitions... and I failed to find the way to add them to the predefined list. What is more, I did add a new color theme, with different name besides default, but it seems still impossible to modify predefined lexer settings.
Any detailed instructions? Thanks a lot.

oBFusCATed

What you want is semantic highlighting (hope the term is correct), which C::B doesn't support.

Something like this: http://zwabel.wordpress.com/2009/01/08/c-ide-evolution-from-syntax-highlighting-to-semantic-highlighting/
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

pomelo

Thanks oBFusCATed! So there is no way to use semantic highlighting in CB?

oBFusCATed

There is one way, you can implement it yourself :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

axmz

hi
I've just installed code::blocks and wanted to write the source code in c language but when I started to type the code I instantly realized that the syntax highlighting wasn't working. I checked the the syntax highlighting menu in the editor settings and there are no predefined modes of any kind. have I missed to install some plug-in or why isn't it working?

Freem

What is your OS?
Which version of C::B are you using?
How did you install it? (compilation of sources, installation from official installer?)

stahta01

@axmz:

What is the file extension; I believe Code::Blocks uses the file extension to determine Language.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

axmz

OS: WinXP
C::B version: 10.05
I installed the official version I downloaded from this official site but I've kinda rushed the installation, so it's possible that I unintentionally overlooked some settings along the way...
File extension is *.c source file (if that's what your question regarded to)