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.
Product Version: NetBeans IDE Dev (Build 201306072301) Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11 System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb) User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev I am expecting the same behavior when pressing ENTER with the caret inside a String. In Java, "foo.|bar" becomes: "foo." + "bar" where | denotes the caret position. In Javascript, "foo.|bar" becomes: "foo.\n\ bar" Please make the Javascript editor behave the same as Java.
Others would oppose that Java does not allow multiline strings while javascript does. So I don't think this should behave the same way.
Petr, This conflicts with my code-formatting configuration that states that long lines should be wrapped. Because Netbeans does not break long Strings, I do it manually, however in the case of multi-line Strings the subsequent line has a different indentation that I'm asking for. Meaning, I'm looking for: var longLine = "abc123...." + "notice the indent of 2"; instead I get: var longLine = "abc123...\n\ notice the indent of 2"; This is undesirable for two reasons: 1. I'm trying to wrap a single-line string for the sake of readability. Introducing \n means I no longer have a single-line string. 2. I cannot use a continuation indent of 2 as I'd like. I'd like to propose changing this issue from a DEFECT to an ENHANCEMENT with the following behavior: 1. Either the code-format engine should break long Strings on my behalf (formatting them as I've mentioned above). 2. Or, the code-format engine should contain an option indicating that hitting ENTER should be treated as Java (split a single-line string instead of introducing a multiline string).
Yep makes sense.
I agree. I just ran into this today and would at least appreciate the option to turn it off.
Vote for an option to turn it on/off.
+1 for an option to turn it on/off.
Yep, just had this annoying problem, so +1 to turn it off (or as an option).
+1