James Fu
James Fu

Reputation: 496

How to highlight current method body in Eclipse?

There is a nice feature called "show selected element only" in Eclipse. When it's turned on, clicking on a method in the outline pane will show just this method only in the editor, allowing to focus on this one only, especially useful in that you don't need to worry about scrolling hard and overshooting this method when there are many nested parenthesis inside.

But sometimes I would like to have a glance of more codes around here, so have to turn this off, then back, time and time again, which is quite inconvenient. So I wonder if there is a better mechanism?

I know a built-in feature called "range indicator" (http://stackoverflow.com/questions/7049098/how-to-forbid-eclipse-to-highlight-current-method-class-in-the-margin) , but I always tend to overlook that because it's too thin.

One better solution I can imagine is using distinguished background color for currently investigated method body, and when move cursor to other methods, background highlight turn to them accordingly (works like the range indicator, but renders more obviously). In this way, both navigation flexibility and reading assistance are gained.

Is this solution possible?

Upvotes: 3

Views: 1673

Answers (2)

vector090
vector090

Reputation: 118

Yes, with editbox and the following settings may suit your need.

enter image description here

enter image description here

Upvotes: 2

Ashutosh Jindal
Ashutosh Jindal

Reputation: 18869

Take a look at the Editbox plugin.

You might have to do a bit of tweaking to the colors to set it up. Here is a sample screenshot :

enter image description here

Is this what you wanted ?

Upvotes: 7

Related Questions