Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to highlight current method body in Eclipse?

Tags:

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?

like image 941
James Fu Avatar asked Mar 12 '26 00:03

James Fu


2 Answers

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 ?

like image 118
Ashutosh Jindal Avatar answered Mar 14 '26 13:03

Ashutosh Jindal


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

enter image description here

enter image description here

like image 41
vector090 Avatar answered Mar 14 '26 15:03

vector090



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!