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 198311 - Wrapping after binary operators
Summary: Wrapping after binary operators
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.0
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-04 12:03 UTC by harryshepard
Modified: 2011-05-07 05:34 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description harryshepard 2011-05-04 12:03:22 UTC
RE: Bug 177010

This may sound really picky but I don't like this change at all. I like to format my code so I can read it easily. This means I don't want really long lines. I don't want

a =
b +
c;

I also don't want

"some text" + "some more text"

I have queries typed in this format:

"a = " + a + "," +
"b = " + b + "," +
"c = " + c + "," +

When I format this the options are horrific. Either:

"a = " + a + "," + "b = " + b + "," + "c = " + c + "," +

or

"a = " +
a +
"," +
"b = " +
b +
"," +
"c = " +
c +
"," +

Both are horrible to look at, not neat at all. It always used to work properly until about 6.7. Surely there is a way to format without creating or removing new lines.

i.e. All my code was broken with the formatter so it went

"a = " + a + ","
+ "b = " + b + ","
+ "c = " + c + ","

Now I want to retain the new lines, but shift the + back to the end of the lines so it is formatted like this:

"a = " + a + "," +
"b = " + b + "," +
"c = " + c + "," +


In summary, format options would be much better if there was an option to "not create or remove new lines" as I want to control where there is a new line in strings or calculations. (Note: this does not apply to the blank space lines such as before/after package, before/after class declaration etc, but only within lines of code)
Comment 1 Dusan Balek 2011-05-06 09:16:35 UTC
Fixed in jet-main. Existing newlines should be preserved when changing form 'before binary operators' to 'after binary operators' and vice versa.

http://hg.netbeans.org/jet-main/rev/e0adfc4b47ef
Comment 2 Quality Engineering 2011-05-07 05:34:57 UTC
Integrated into 'main-golden', will be available in build *201105070000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/e0adfc4b47ef
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #198311: Wrapping after binary operators - fixed.