Skip to main content



      Home
Home » Newcomers » Newcomers » How do I change highlighting of C++ preprocessor directives?
icon5.gif  How do I change highlighting of C++ preprocessor directives? [message #758631] Wed, 23 November 2011 19:31 Go to next message
Eclipse UserFriend
Ok so suppose I have this:

#define MYDIRECTIVE

#ifdef MYDIRECTIVE
bool myswitch = 1;
#else
bool myswitch = 0;


Eclipse will go ahead and white out the bottom half of that if statement (because MYDIRECTIVE is defined), which is fine, but I'd like to change the color of that highlighting. I initially thought to look here: Windows->Preferences->C/C++->Editor->Syntax Coloring->Preprocessor

However, all I find there is how to change the coloring of the preprocessor text, not the highlighting. Any ideas? I'm using Eclipse 3.7.0 with the eclipse color theme plugin v0.11.0, running on ubuntu.

[Updated on: Thu, 24 November 2011 23:37] by Moderator

Re: How do I change highlighting of C++ preprocessor directives? [message #764817 is a reply to message #758631] Mon, 12 December 2011 17:37 Go to previous messageGo to next message
Eclipse UserFriend
For CDT, I've found this in Windows > Preferences > C/C++ > Editor. In the list of "Appearance Color Options" you'll find the "Inactive Code Highlight" sets the value for disabled code. In the example you presented above, the last 2 lines would be highlighted by this color.
Re: How do I change highlighting of C++ preprocessor directives? [message #767873 is a reply to message #764817] Mon, 19 December 2011 00:45 Go to previous messageGo to next message
Eclipse UserFriend
Great, thanks for this Smile
Re: How do I change highlighting of C++ preprocessor directives? [message #1727472 is a reply to message #764817] Wed, 23 March 2016 05:53 Go to previous messageGo to next message
Eclipse UserFriend
Exists there a way to just "gray-out" disabled code like VS?

Re: How do I change highlighting of C++ preprocessor directives? [message #1727532 is a reply to message #1727472] Wed, 23 March 2016 10:31 Go to previous messageGo to next message
Eclipse UserFriend
On 03/23/2016 03:53 AM, Harald-R. Flasch wrote:
> Exists there a way to just "gray-out" disabled code like VS?

Since this is for C/C++, you might get better help in the Eclipse CDT
forum. Different languages have their own editors in Eclipse.
Re: How do I change highlighting of C++ preprocessor directives? [message #1727538 is a reply to message #1727532] Wed, 23 March 2016 11:27 Go to previous message
Eclipse UserFriend
Thank you for your reply. I am (more or less) new to Eclipse ... Using Mars.1 and C/C++ GCC project.

EDIT:
"Eclipse CDT" is part of the bundle we've installed.

[Updated on: Thu, 24 March 2016 09:51] by Moderator

Previous Topic:What does "exclamation mark" (!) mean on xubuntu eviroment? Eclipse program.
Next Topic:How to start a plugin by an event trigger
Goto Forum:
  


Current Time: Thu Jul 24 16:54:24 EDT 2025

Powered by FUDForum. Page generated in 0.07901 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top