Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: zeroth on January 18, 2013, 06:45:34 pm

Title: Solved: Code Dimmed for successful#ifdef block
Post by: zeroth on January 18, 2013, 06:45:34 pm
I've got a defines listed in my project's build options, and an #ifdef for it in a cpp file. the define is true, and the code compiles and executes. however, codeblocks dims the code inside the #ifdef block... and it shouldn't. It's annoying to code in this area because of this.

Is this a bug or was codeblocks just never coded to look for defines there? I'd hack in a quick work-around if I knew what I was looking for... is "code dimming" the proper terminology for this feature?

CodeBlocks svn 8468
Title: Re: Code Dimmed for successful#ifdef block
Post by: Jenna on January 18, 2013, 06:53:42 pm
This depends on the version of C::B you use.
Look into "Settings -> Editor ... -> General settings -> C/C++ editor settings".
Title: Re: Code Dimmed for successful#ifdef block
Post by: zeroth on January 18, 2013, 07:51:28 pm
I presume "Collect defines from the project file" is what you were looking for?

(http://bcaptain.net/settings.png)
Title: Re: Code Dimmed for successful#ifdef block
Post by: zeroth on January 18, 2013, 08:17:02 pm
After unchecking and re-checking that option, the problem is now resolved.
Title: Re: Solved: Code Dimmed for successful#ifdef block
Post by: euzkoarima on January 18, 2013, 11:06:53 pm
I'm using 12.11 release version on Ubuntu 12.04
Works ok with defines in build options and defines in the same source, but fail with defines in headers !!