Issue
When scrolling in the Netbeans editor and unfolding a code block with the + on the left, the editor scrolls back to the cursor position automatically.
Does anybody know how to disable this behaviour?
Solution
It's a known critical bug.
Collapsing a block often results in a jump of the editor to an incorrect editing position (and scrolling the page cause a rejump to that position after a second of scroll inactivity). The same sources works perfectly with Netbeans 8.2.
Apparently, it was introduced when fixing another bug right before or during the donation of NetBeans to the Apache Foundation. Probably, for now (NetBeans 11.3), you have no option rather than using NetBeans 8.2 or waiting for 12.0 or 12.1 or later.
You can always vote for the bug in the NetBeans issue tracker. More votes, more attention, faster fixing.
Answered By - Dmitry.M