Author Topic: Syntax highlighting of disabled blocks  (Read 3694 times)

fthieme

  • Guest
Syntax highlighting of disabled blocks
« on: February 21, 2007, 09:39:35 pm »
is there a way to let blocks surrounded by #if 0 ... #endif "disappear" like comments do?

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Syntax highlighting of disabled blocks
« Reply #1 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.

fthieme

  • Guest
Re: Syntax highlighting of disabled blocks
« Reply #2 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, ...


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: Syntax highlighting of disabled blocks
« Reply #3 on: February 22, 2007, 04:22:01 pm »
Settings -> Editor -> Folding,
Enable "Fold preprocessor commands".
-> Fold the preprocessor command "#if 0"... ;-)
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ