X

Geertjan's Blog

  • May 9, 2008

Navigate Between Marked Occurrences

Geertjan Wielenga
Product Manager
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.

Join the discussion

Comments ( 2 )
  • Vladimir Voskresensky Tuesday, May 13, 2008

    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++


  • Vladimir Voskresensky Friday, June 6, 2008

    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


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.