NetBeans 13 XML folded blocks automatically unfolding
Apache NetBeans version
Apache NetBeans 13
What happened
Hi,
I've recently started using NetBeans for XML file editing. I've installed the latest version and have an issue with even simple XML files. I have not added any plugins and since I have only just started using NetBeans I don't know if this happened in previous versions.
I am finding that nodes that I have folded automatically unfold whenever I start to edit a different node. It doesn't seem to be time related and the nodes I am editing are NOT part of the node that automatically unfolds.
I initially installed NetBeans on my Linux VM and thought it might be an issue there, but the same thing happens with a fresh install on evil Windows 10.
I tried creating the simplest XML file:-
<?xml version="1.0" encoding="UTF-8"?>
<root>
<data>
<field name="some field"/>
</data>
<another>
<more id="test"/>
<onemore name="rob"/>
</another>
</root>
If I collapse the "<data>" node, then click my mouse on the end of the "<onemore>" row, hit enter, or paste some text, the collapsed "<data>" node automatically un-folds.
I've tried different versions of the jdk using --jdkhome command line option. I have also tried using a completely new --userdir directory, the same thing keeps happening, so I assume it can't be an option I have set.
I've attached a screen record of it happening of the evil Windows installation.
robgerrrr
NetBeans->Help->About _Product Version: Apache NetBeans IDE 13 Java: 18; OpenJDK 64-Bit Server VM 18+37 Runtime: OpenJDK Runtime Environment 18+37 System: Linux version 5.16.16-200.fc35.x86_64 running on amd64; UTF-8; en_GB (nb) User directory: /home/rgriffit/.netbeans/13 Cache directory: /home/rgriffit/.cache/netbeans/13
https://user-images.githubusercontent.com/103207287/162255200-c2651258-8eda-43dc-b3e0-832c02833e18.mp4
_
How to reproduce
Create a simple XML file:-
<?xml version="1.0" encoding="UTF-8"?>
<root>
<data>
<field name="some field"/>
</data>
<another>
<more id="test"/>
<onemore name="rob"/>
</another>
</root>
Collapse the "<data>" node, then click on the end of the "<onemore>" row, hit enter, or paste some text, the collapsed "<data>" node automatically un-folds.
Did this work correctly in an earlier version?
No
Operating System
Fedora 35 and Windows 10
JDK
jdk18 and jdk11
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
Every time. I've only used it for XML files, but it doesn't matter if they are large or small
Are you willing to submit a pull request?
No
Code of Conduct
Yes
I can reproduce with PHP files too. For me it happens, when I hover the folded block and shows me the preview of what it is inside. And also, when I scroll and the editor shows me a line which is not available anymore. It happens in NetBeans 14 too with open JDK 14, Windows 10.
Same issue for me but i can not reproduce behavior :( Fold some functions. editing in other programs or do other stuff, come back after a while and see my code is completly unfolded. On NB restart, all is unfolded. Since NB8 i think this behavior exists.
In options: Enabled Folding; Collapse by default: Initial Comment is activated. I disabled it now to check new behavior....