Page 1 of 1
multiple text backgrounds
Posted: Wed Aug 07, 2013 2:23 pm
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.
Re: multiple text backgrounds
Posted: Wed Aug 07, 2013 3:15 pm
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 (16.23 KiB) Viewed 9090 times
Re: multiple text backgrounds
Posted: Wed Aug 07, 2013 3:44 pm
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.
Re: multiple text backgrounds
Posted: Wed Aug 07, 2013 4:04 pm
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.
Re: multiple text backgrounds
Posted: Wed Aug 07, 2013 4:17 pm
by cbein
Thanks. I think code folding will be the best alternative.
Re: multiple text backgrounds
Posted: Wed Aug 07, 2013 6:40 pm
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#.
Re: multiple text backgrounds
Posted: Wed Dec 17, 2014 2:38 am
by lisaa
Awesome work, thanks!!!