multiple text backgrounds

Topics for the Eclipse Environment
Post Reply
cbein
Posts: 8
Joined: Mon Jul 08, 2013 8:01 am

multiple text backgrounds

Post by cbein »

I am working on a project that contains a lot of code, and I am trying to figure out a way to change the background or highlight certain parts of the code. Different backgrounds for functions, declarations, loops, etc... would just debugging easier.

Is there a way to do this in the Netburner's Eclipse IDE? I know this is possible in Notepad++ or similar editors, but I would prefer not to switch back and forth. I apologize if this should be obvious, but I have not had any luck finding an answer.
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: multiple text backgrounds

Post by tod »

Use Quick Access (the default keystroke is Ctrl-3) and type color. In the list you'll see the preference setting for C++ syntax coloring (see image). Use this to see if you can get what you're after. (You'll also notice there are other coloring options).

<Promo>I just finished recording my Eclipse course for Pluralsight. It's in the editorial review process right now. Hopefully it will be live soon! </Promo>
QuickAccessSyntaxColor.png
QuickAccessSyntaxColor.png (16.23 KiB) Viewed 9088 times
cbein
Posts: 8
Joined: Mon Jul 08, 2013 8:01 am

Re: multiple text backgrounds

Post by cbein »

I am not sure this has what I want to do. I understand that I can change the syntax coloring, but basically, I want to be able to highlight a section of code and give it a different style/color. This way I can make say lines 50-200 have a yellow background and lines 200-400 have a blue background.

I don't think I can do this through preferences since the adjustments made always apply to the entire document.
User avatar
Forrest
Posts: 287
Joined: Wed Apr 23, 2008 10:05 am

Re: multiple text backgrounds

Post by Forrest »

Hello,

This is not possible in eclipse afaik. Not sure if it would help, but you can enable code folding to hide code you are not working on
cbein wrote:I am not sure this has what I want to do. I understand that I can change the syntax coloring, but basically, I want to be able to highlight a section of code and give it a different style/color. This way I can make say lines 50-200 have a yellow background and lines 200-400 have a blue background.

I don't think I can do this through preferences since the adjustments made always apply to the entire document.
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
cbein
Posts: 8
Joined: Mon Jul 08, 2013 8:01 am

Re: multiple text backgrounds

Post by cbein »

Thanks. I think code folding will be the best alternative.
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: multiple text backgrounds

Post by tod »

I did some searching and I can't even find a plug-in that does this. On the code folding approach, you can turn on code folding for pre-processor directives and then surround multiple methods with
#if (true)
#endif
and do code folding similar to how regions work in C#.
lisaa
Posts: 1
Joined: Wed Dec 17, 2014 2:36 am

Re: multiple text backgrounds

Post by lisaa »

Awesome work, thanks!!!
Whether you want to pass 70-412 exam exam exams or looking for test king certification, our bfit can provide guaranteed success in real exam of www.sckans.edu ccna training are also having Uniformed Services University of the Health Sciences
Post Reply