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.
To reproduce: clone document, now two panes A,B for same Document. Drag a pane so that both A,B are visible. Position caret near top of document in A, and near bottom of document in B. Add lines to A, observe that B scrolls. I did this with .java files.
I was able to reproduce in trunk. The second view simply retains its visual bounds (starting coordinates and size of the view's extent) so it does not react to modifications in any way. If subsequent lines are added to the A then the caret in B will eventually go outside of the view's extent. To fix this the second view has to track document's modifications and if they are before its starting y coordinate it must scroll down/up by the amount of inserted/removed content.
I've fixed this in jVi, its a generic swing issue that has nothing to do with NB. I am attaching a simple class that can be used anywhere to address the problem. I use it as an inner class, so its missing imports. I don't know how well it fits into NB. Optimally it would only be started on a JEditorPane that is being deactivated and that has a clone. (jVi does it for any deactivated editor; since they won't usually get document events, there's not really much of an impact). Having a "JTextComponent.freezeViewport()" method seems like what's really needed (I'm assuming that is where the issue is). Hopefully, I'll be starting an NB6.0 port of jVi relatively soon, after the 5.5 is stable. If this fix looks usable, I might be able to integrate it into NB with some direction. (If one is ever working with two views of the same file, I'm sure this priority would be higher :))
Created attachment 37893 [details] Basics of a patch
Thanks for the patch. We'll have a look.
The code I sent has a deadlock problem. If DocumentEvent analysis determines that viewport should be adjusted, the adjustment must be done in event thread.
Resolving all issues with milestone "future" as LATER. If you feel strongly that it should be implemented please reopen and set the target milestone to "next".
NetBeans.org Migration: changing resolution from LATER to WONTFIX