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.
You get a split second to see the correct line before the editor scrolls down and puts the line out of sight. Sometimes, it will scroll AGAIN when you try to navigate to the destination again, leaving one to obsessively click the navigation thing until it stays where it should be. I suspect this is related to setting collapse imports by default to true and editor folds collapsing.
An example of such navigation is clicking error links in the output window.
Created attachment 164339 [details] Sample application reproduction case: locate the JPanel form in the explorer. Do not open it directly, but through the navigator open at variable "b". When the autogenerated code autofolds, the caret position goes out of sight. If cannot be reproduced, fiddle with whitespaces before/after - behaviour likely depends on the screen height.
*** Bug 267304 has been marked as a duplicate of this bug. ***
I've patched editor caret + folding to somehow mitigate the issue in jet-main#15039b6a58b8. Note that because there are more asynchronous processes and I was not able to make the caret position entirely fixed. Sometimes the caret's line will move up or down after autofolding, but will stay visible. Sometimes the screen will momentarily flick as paint on wrong + immediate paint on the correct position occurs. I am not closing the bug, but lowering the priority - now its "only" visually unpleasant, but you should be able to see the code navigated to.
Integrated into 'main-silver', will be available in build *201705241652* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/15039b6a58b8 User: Svata Dedic <sdedic@netbeans.org> Log: #270172: attempt to maintain caret position after autofolding