This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 224754

Summary: Variables window: Strings: Don't convert newlines to spaces when selecting (c&p a nightmare)
Product: debugger Reporter: almson
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.2.1   
Hardware: PC   
OS: Other   
Issue Type: ENHANCEMENT Exception Reporter:

Description almson 2013-01-11 11:35:47 UTC
I have a simple, common use case. I want to copy a string in the variables window and paste it into code (often when writing a unit test). The problem is that while the variables window shows the escaped newline characters (ready for c&p), as soon as you click into it they get turned into spaces. What good are spaces? What can I do with them? Of course, I can click "..." and see the newlines as newlines, but pasting that as an escaped string is also a problem (there are plugins, but even they can be frustrating).

Keep the newlines (and other special chars) escaped when selecting text in the variables window. Converting newlines to spaces does nobody any good.
Comment 1 Martin Entlicher 2013-01-11 16:39:45 UTC
This is a behavior of the org.openide.explorer.propertysheet.StringImplaceEditor
It's the JTextField, which replaces newlines with spaces.
Since replacement of newlines with \n has a sense in a source code only, we should not do it directly in the generic StringImplaceEditor.
Most probably, debugger would have to define it's own property editor for Strings.
Comment 2 almson 2013-01-11 18:13:14 UTC
I think this should be fixed in StringInplaceEditor. If it shows '\n' unfocused, then when focused/selected, it should continue to show that. Simple as that.
Comment 3 almson 2013-01-15 15:39:54 UTC
While we're at it, can the string editor show all other non-printable characters? In particular, it does not display the Unicode BOM ('\uFEFF'), which caused me some consternation today.