Bug 115210 - [formatter] Wrapping of operators not how I like it(!)
Summary: [formatter] Wrapping of operators not how I like it(!)
Status: VERIFIED DUPLICATE of bug 79068
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-05 10:16 EST by Ian Brown CLA
Modified: 2007-04-27 07:43 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Brown CLA 2005-11-05 10:16:56 EST
The code formatter continues to be an excellent feature of Eclipse, but there 
is one aspect that offends my sensibilities...

Binary expressions wrap and place the operator at the start of the next line. 
I'd much prefer the operators at the end of the previous line, for example:

Eclipse 3.2 formatter now gives me this (3.1 did, too):
      int sum = 100 + 200 + 300
                + 400 + 500 + 600
                + 700 + 800;

But I would prefer:
      int sum = 100 + 200 + 300 +
                400 + 500 + 600 +
                700 + 800;

This is when set to "wrap when necessary" and "column indent". I might choose 
different options, but the key idea is that the operator should (IMHO) be at 
the end of the line, not the start
Comment 1 Olivier Thomann CLA 2005-11-10 11:24:32 EST

*** This bug has been marked as a duplicate of 90238 ***
Comment 2 Ian Brown CLA 2005-11-10 12:21:50 EST
Are you sure this is a dup of 90238?

That appears to be talking about Eclipse breaking at whatever point it decides 
to to match the max-linelength, whereas my issue is that when it decides to 
wrap, it wraps before the operator, not after it

If I have
int a = 100 + 200 + 300 + 400;

there is no line-length I could specify to make it produce
int a = 100 + 200 + 
        300 + 400;

It will always come up with
int a = 100 + 200 
        + 300 + 400;

even if that leaves enough whitespace after '200' to put the '+' on the same 
line.

Your assessment that it is a dup is on much better info than I have, so I 
trust your choice - I just wanted to make sure :)
Comment 3 Olivier Thomann CLA 2005-11-10 12:29:46 EST
I missed the right bug id. Reopen to close as dup of bug 79068.
Comment 4 Olivier Thomann CLA 2005-11-10 12:29:52 EST

*** This bug has been marked as a duplicate of 79068 ***
Comment 5 Maxime Daniel CLA 2007-04-27 07:43:25 EDT
Verified for 3.3 M7 using build I20070427-0010.