Friday May 09, 2008
Navigate Between Marked Occurrences
One of the dozens of interesting things I've picked up at JavaOne is... a very cool new keyboard shortcut that is in post-6.1 development builds. I.e., this is not in 6.1. You'd need to get a development build. Once you've done so, put your cursor on an identifier in your Java code, as shown below:
Great, all the occurrences of the selected identifier are marked, as in 6.0 and 6.1. Now how do you navigate between those marked occurrences? Wouldn't it be cool if you could hold down the Alt key and then use the Up arrow and Down arrow to navigate up and down the occurrences that have been marked? You can't do that in 6.1, but in development builds, that's exactly what you can do.
Vladimir Voskresensky from the NetBeans C/C++ development team in St. Petersburg told me about this on NetBeans Day. It's something he committed to the NetBeans sources, after having initially created it for the C++ editor. Thanks Vladimir. One thing I noticed is that the selected identifier suddenly changes while I am navigating, so that I can't navigate all the way down the list because the marked occurrence suddenly changes.
May 09 2008, 08:22:18 AM PDT Permalink
Mark occurrences is changed, because of bug in Java impl. If you simply put cursor in the beginning of identifier in function call, like in
equals(|obj)
unfortunately "equals" becomes highlighted, not "obj". So when you navigate with ALT+UP/DOWN cursor is moved in the beginning of identifier and ... because of the above bug your selection is changed :-( We don't have such problems in C++ :-). And just a note: this works fine in 6.1 release for C++
Posted by Vladimir Voskresensky on May 13, 2008 at 07:00 AM PDT #
I've put workaround for it was part of http://www.netbeans.org/issues/show_bug.cgi?id=136665
now object is not lost, just cursor is positioned at the end of identifier
Posted by Vladimir Voskresensky on June 06, 2008 at 09:06 AM PDT #


