Skip to main content

Unmark Occurrences

Posted by gsporar on September 21, 2007 at 3:28 PM PDT

The beta release of NetBeans IDE 6.0 came out earlier this week. The entire feature
list
is lengthy, and instead of rehashing that here,
what I have been doing lately
is to focus on the "little things" that I have found while using the IDE. These
are features that I particularly like or that might be easily overlooked.

One of these features in the editor is Mark Occurrences. It is pretty straightforward:
put your cursor on something and the editor highlights all occurrences of
that thing, be it a variable, method, method exit points, etc.

mark.png


I should point out that this feature has actually been available for a long time
now to NetBeans IDE users. The prolific Sandip Chitale wrote a plugin module
for it long ago (I even created a screencast to demonstrate it). But in 6.0
the feature is included in the standard distribution.

Which is great. The only thing I'm not crazy about is that by default
the highlighting marks stick around, even after I move the cursor away. The marks do
not disappear until I put the cursor on something else that can be highlighted.

I would guess most folks prefer it this way, but I have always been a bit
odd. :-) This is what user definable options are for - allowing each of
us to do our own thing. In this case, Tools > Options provides:

moptions.png


The Options dialog not only allows me to control what sorts of things get
highlighted, but I have also disabled the default "Keep Marks" option so that
as soon as I move the cursor off of whatever was being highlighted, the highlights
go away.

One final note: it appears that even though the control for Mark Occurrences
is under the Java Code section in the Options dialog, the Ruby and JavaScript
editors seem to abide by the setting of the "Keep Marks" option. I have filed an IssueZilla entry to get that improved....