apache / apache/netbeans

NetBeans 13 XML folded blocks automatically unfolding

Open
#3,939 2 comments 0 reactions 0 assignees View on GitHub
Editor kind:bug needs:triage XML
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### 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:-

```







```
If I collapse the "``" node, then click my mouse on the end of the "``" row, hit enter, or paste some text, the collapsed "``" 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:-

```







```
Collapse the "``" node, then click on the end of the "``" row, hit enter, or paste some text, the collapsed "``" 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

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the minimal XML file described in the report: collapse the node, then edit the separate row. Start by tracing the NetBeans XML editor's code-folding behavior; done means the collapsed node stays folded after clicking, pressing Enter, or pasting elsewhere.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.