apache / apache/netbeans

Filename in tab stripped when filename has space and parent foldername is shown

Open
#4,359 8 comments 0 reactions 0 assignees View on GitHub
Contribution welcome kind:bug stale UI
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 14

### What happened

When I open a file with a filename includes spaces e.g. "For home.txt" and set the option to show the parent folder name in tab, the filename is stripped after the space which looks weird and not correct. I expect to see the full name, because afaik NetBeans has no max-width for tabs shown which is good, due to seen the full filename.

![image](https://user-images.githubusercontent.com/795658/178142087-2a9f1f64-55f2-47f2-8587-2808d9819c9e.png)

It seems that this sometimes happens for files with lower case name included.
* Desktop\For home.txt - stripped
* Desktop\test test.txt - stripped
* Desktop\Binwalk Firmware.txt - not stripped

Also it is not happen when the parent folder name has also spaces "Test Test\test test.txt" - not stripped

### How to reproduce

* Open a file which includes a space in the name of the file, not in the folder
* Open tools -> options -> appearance -> document tabs -> and set option "show parent folder name in tab title"
* Click apply
* Tab in the background updates and show now folder name and filename is striped.

### Did this work correctly in an earlier version?

No

### Operating System

Windows 11

### JDK

OpenJDK 14

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

Until 12.6 I can reproduce, before I don't have an instance anymore to check it. I thought that this was working long time ago but I can't really remember. Also it has nothing todo with FlatLaF. I changed to Windows LaF and it still happens.

I always test bugs with a fresh clean user dir.

### Are you willing to submit a pull request?

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in Apache NetBeans 14 using the document-tabs setting to show the parent folder name, with filenames such as "For home.txt" and "test test.txt". Trace the document-tab title handling and verify the fix by confirming that filenames containing spaces remain fully visible while the parent folder name is shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.