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.
Summary: | Pressing ENTER inside string inserts \n\ | ||
---|---|---|---|
Product: | javascript | Reporter: | _ gtzabari <gtzabari> |
Component: | Editor | Assignee: | Petr Pisl <ppisl> |
Status: | REOPENED --- | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 7.4 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
_ gtzabari
2013-06-13 15:49:45 UTC
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 |