I love the color themes (thanks!), but one seriously nagging issue is that the code that is #ifdef'd out, is impossible to read (and annoyingly bright). If I highlight those lines, I can read it, but I'd really really rather not see it at all. Seems to be a similar issue as the one for tool-tips, but I am hoping that there is a setting somewhere to turn off the syntax highlighting for inactive code. I have looked and not found it, but that doesn't necessarily mean it doesn't exist. I am an optimist (in this regard anyway).
-
@Sergei answered your question. I tried it and it worked for me. – yehudahs Oct 16 '15 at 18:38
5 Answers
You can disable #ifdef highlighting entirely by going to:
Window -> Preferences -> C/C++ -> Editor and unchecking the box "Highlight inactive code".
Also, you can change the #ifdef highlighting color by going to that same screen and changing the "Inactive code highlight" color (under "Appearance color options" heading) to a color that works better for you.

- 755
- 1
- 7
- 17

- 1,359
- 1
- 13
- 13
-
This solution works for me on Windows using Visual Studio as compiler, probably because Eclipse thinks the symbols are undefined and so the code is all inactive. Not sure how to solve the situation where the symbols are defined and active, as here:http://stackoverflow.com/questions/19039874/can-i-have-eclipse-highlight-an-ifdef-block-of-code-regardless-of-whether-the-s?lq=1 – MonkeyWithDarts Nov 05 '13 at 20:07
-
1
-
Window -> Preferences -> C/C++ -> Editor -> Appearance code options -> Inactive code highlight Choose another color. I prefer grey.
I also recommend to change occurrences background: General -> Editors-> Text Editors -> Annotations -> C/C++ Occurrences

- 4,217
- 3
- 39
- 54
I found this: https://github.com/eclipse-color-theme/eclipse-color-theme/issues/35
"Preferences -> C/C++ -> Editor, “Highlight inactive code” checked, Appearance color options: Inactive code highlight."
This turns off the highlighting for the inactive parts of the code, making them readable again. I haven't found a way yet to change the highlighting color.

- 71
- 1
Well, I found a partial answer:
Preferences -> C/C++ -> Editor -> syntax highlighting -> preprocessor -> directives changed the foreground color to black.
Preferences -> C/C++ -> Editor -> syntax highlighting -> preprocessor -> others changed foreground color to black
Preferences -> C/C++ -> Editor -> syntax highlighting -> code -> others changed foreground color to black.
At least now I can see it. Anyone know how/where to change the background color for those blocks?
Thanks!

- 1,842
- 3
- 22
- 32
I was looking also for write occurance background. I'll recommend for everybody to change also "Test as" to "Dashed Box" in: Preferences -> General -> Editors -> Text Editors -> Annotations -> C/C+ Write Occurrences

- 853
- 1
- 10
- 13