3

Code between #if SYMBOL and #endif is greyed out in cc-mode if the SYMBOL has not been defined within the current file.

The project that I´m currently working on has a common code base for Mac and Windows so there´s a lot of #if WINDOWS and #if MAC in there. This results in lots of code in the editor that is grey and without syntax highlighting since these symbols are defined in some other compilation unit.

How can I enable syntax colouring in the current editor without editing the file? I can always add a #define SYMBOL 1 above the #if SYMBOL but this does not feel right?

Drew
  • 75,699
  • 9
  • 109
  • 225
Mikael Springer
  • 513
  • 3
  • 13
  • 2
    I don't think cc-mode does this by default. Are you using `hide-ifdef-mode` by any chance? – rpluim Sep 14 '18 at 09:18

1 Answers1

1

It was emacs-cquery that shadowed code inside #if false regions. Setting cquery-enable-inactive-region to nil solved it.

Mikael Springer
  • 513
  • 3
  • 13