netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

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

Open Chris2011 opened this issue 3 years ago • 4 comments

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

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

Chris2011 avatar Jul 10 '22 11:07 Chris2011

sounds like a good first issue. Main challenge will be to find the right module to start the investigation, so if anyone knows post it here.

mbien avatar Jul 11 '22 09:07 mbien

I tried to reproduce this issue but was unable.

If anyone want's to try the code that sets the tab name is here: netbeans/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/FolderNameTabDecorator#getText

zephyrgr avatar Jul 21 '22 19:07 zephyrgr

Hello @mbien @Chris2011 , I am a student learning the ins and outs of GitHub and currently have an assignment that requires us to have an issue that we feel confident in solving assigned to us. I would appreciate it if you could assign this issue to me so I can give it a try. Thanks in advance!

Johnny11502 avatar Oct 11 '22 20:10 Johnny11502

@Johnny11502 done. Good luck :)

mbien avatar Oct 11 '22 20:10 mbien

@mbien Sorry for the lack of updates but I did end up completing a different issue for my assignment. This was one of the three I chose in case I had issues getting the first one assigned to me. I appreciate you allowing me to keep it for so long, Thank you for understanding.

Johnny11502 avatar Oct 24 '22 17:10 Johnny11502