Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: fthieme on February 21, 2007, 09:39:35 pm

Title: Syntax highlighting of disabled blocks
Post by: fthieme on February 21, 2007, 09:39:35 pm
is there a way to let blocks surrounded by #if 0 ... #endif "disappear" like comments do?
Title: Re: Syntax highlighting of disabled blocks
Post by: raph on February 21, 2007, 10:18:02 pm
Haven't tried it, yet, but you may use "Edit"->"Comment" and "Edit"->"Uncomment" to disable your code.
Title: Re: Syntax highlighting of disabled blocks
Post by: fthieme on February 22, 2007, 08:38:32 am
Yeah, sure you can use comment/uncomment. But that's not what I want. I just want to have these blocks in the same color as comments - or at least in some configurable color.

Because of two reasons

1. It is no comment, but a disabled block -> you should use #if 0 ... #endif
2. There is a lot of code with this and you should see that it is no active code, as it is done with vim, KDevelop, ...

Title: Re: Syntax highlighting of disabled blocks
Post by: MortenMacFly on February 22, 2007, 04:22:01 pm
Settings -> Editor -> Folding,
Enable "Fold preprocessor commands".
-> Fold the preprocessor command "#if 0"... ;-)
With regards, Morten.