[
https://issues.apache.org/jira/browse/NETBEANS-2082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17107472#comment-17107472
]
Ernie Rael commented on NETBEANS-2082:
--------------------------------------
A breakpoint shows something from the EventQ, so probably need to approach it
from the folding code side. There's a q'd COMPONENT_RESIZED event, that
JViewport turns into a changeEvent. When changeEvent processed,
viewport.getViewPosition() has the big jump. Resize event makes sense, the
overall size of the text view has changed due to the folding change, but
where's the scroll to cursor coming from?
The suspect, mentioned in
https://issues.apache.org/jira/browse/NETBEANS-2082?focusedCommentId=17019778&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17019778
, is all about maintaining cursor positon and keeping it visible. I don't
fully understand the bug it is trying to fix, but maybe maintaining view port
position instead of cursor might help.
In any event, it could be that taking out the line
{code:java}
comp.putClientProperty("editorcaret.updateRetainsVisibleOnce", Boolean.TRUE);
{code}
would revert the behavior. The triggering bug report, #270172, says
"...navigating to a line in a newly opened file" which might be less painful
than always screwing up.
I initially couldn't reproduce the problem; I tried jVi disable, then the bug
reproduced OK. Looks like using jVi is a workaround ;) . I reproduces quite
easily, very annoying if you care.
> Scroll to the caret position when code fold feature is run
> ----------------------------------------------------------
>
> Key: NETBEANS-2082
> URL: https://issues.apache.org/jira/browse/NETBEANS-2082
> Project: NetBeans
> Issue Type: Bug
> Components: editor - Code folding
> Affects Versions: 10.0, 11.0, 11.1, 11.2
> Environment: Netbeans 11 with OpenJDK 12.
> Darwin MacBook-Pro-2.local 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11
> 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64
> Netbeans 10 with OpenJDK 11.
> Darwin MacBook-Pro-2.local 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20
> 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64
> Reporter: Pier Luigi
> Assignee: Svatopluk Dedic
> Priority: Critical
> Attachments: DemoPHPCodeFoldingProblem_NB11.php, netbeans-2082.gif
>
>
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists