Community
Participate
Working Groups
I love the feature of pasting multiline text into a source file where I automatically get concatenated strings with line breaks on the correct positions: String data = " \"first line\\r\\n\" + \r\n" + " \"another one\\r\\n\" + \r\n" + " \"and the final line\""; Now after formatting the source file this nice structure is obviously gone depending on the line length parameter: String data = " \"first line\\r\\n\" + \r\n" + " \"another one\\r\\n\" + \r\n" + " \"and the final line\""; I know I may disable the formatter with // @formatter:off But it would be a nice feature if these control statements would be automatically added when I paste multiline text. Eg made available through a checkbox in prefs/ editor/typing
You can disable joining already formatted lines (Code Style > Formatter > Edit > Line Wrapping tab). Does that solve your problem, or do you really want to "pollute" your code with the formatter directives?
In my case I would prefer to go with the directives. Enabling "Never join wrapped lines" seems to be odd eg if you simplify a long statement that got wrapped it will not be joined anymore to a single line.