Eclipse "align fields in columns" changed with Mars
Asked Answered
L

1

8

When enabling the formatting option "align fields in columns" all member fields get aligned, like this:

  int    member1             = 1;
  int    member2WithLongName = 2;

  int    member3             = 3;
  String member4             = "asdf";

after switching to the Mars Release (4.5) this changed slightly. Members now get first grouped (by blank lines between them) and then aligned, resulting in an alignment like this for the above example:

int member1             = 1;
int member2WithLongName = 2;

int    member3 = 3;
String member4 = "asdf";

aligning is done based on the groups instead of based on all members.

Grouping members sometimes make sense to have a clear separation of static/final members / constants... Aligning based on these groups might make sense, too - but might screw up formatting between team members that use the latest release or older ones.

So the question is whether this can be configured to behave like previous releases. Or is this something only I experience and something went wrong when upgrading?

Leaguer answered 1/7, 2015 at 18:39 Comment(5)
Okay seems like I'm not the only one wondering about this, see Bug in Eclipse Bugzilla: bugs.eclipse.org/bugs/show_bug.cgi?id=470506Leaguer
I have the same problem and still looking for a solution.Renege
Great spot on the grouping by blank lines... hadn't worked that one outMastitis
Problem has been fixed, update will be released to Eclipse 4.5.1 in late September.Phalarope
I wish there was an option to choose between these two modes. I liked the behavior before the "fix" :-)Eddra
D
1

There is "Blank lines separating independent groups" property in Neon.

Detrusion answered 6/7, 2016 at 7:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.