This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Expected behavior: When using the find tool from explorer, it is expected that the Java editor sets the caret position on the line of the position that is shown in the right half of the Search Results dialog when one hits [Enter] on it. What actually happens: The file is opened but after apparently locating for a fraction of a second (on a slow PC, 200MHz. on faster PCs this might not be visible), the caret position jumps to the top of the file and stays there. How to reproduce: Concentrate on a single file. Ensure that the file is not already open in the editor. In the Search Results dialog, press [Enter]while the focus in on a line in the right half. This error reproduces in about 60% of all cases so you might have some difficulty in reproducing this. It appears that this fails only with the [Enter] key while it works with mouse double clicks. Workaround: Repeat the action by switching back to the Search Results dialog and hitting [Enter] on the found position line again. Or use the mouse.
I have to correct one of my statements. The error DOES reproduce with mouse double clicks also.
*** Issue 26796 has been marked as a duplicate of this issue. ***
It seems that the problem is in the openide. How to reproduce the problem very simply: just open some java file from explorer. Cursor should be at the class declaration, but sometimes it jumps to the top of the document. This can be reproduced even with editor module uninstalled. Reassigning to openide. The problem: CloneableEditor.setDot (around line 226) is performed twice. The first time it sets the cursor correctly, secondly to the top of the document. Please see attached stack trace.
Created attachment 7495 [details] Set dot stack trace after opening the java file from explorer
Platform/OS independent.
reassigne to David K., new owner of editor
It looks like this has been partly fixed, possibly in relation to issue 31750. Not bad! However it's not 100% ok yet. Now the cursor position is right but the focus does not work i.e. the find dialog keeps it and the source file editor does not get it. This is in SDI mode, I don't know about MDI. Try a result list with a few entries at least. The first time it works but subsequent clicks on list entries further down the list don't transfer focus to the editor.
I tried it but I'm not able to reproduce it. I have the latest dev build in SDI mode and Search result dialog showing several matches. Whenever I double click some position in bottom right list box the editor is correctly focused. Anyway if there is problem like this then it is most probably in utilities component and not in openide. Please file separate issue for them. Thx.
This works for me(reporter), too. Thanks.
closing