Community
Participate
Working Groups
When blank lines are left inside a method, or for example in the field definitions, the code formatter still removes them and places them all together, regardless of whether I've set the properties: Number of empty lines to preserver = 10 and Preserve existing line breaks = true Example: public class MyClass { private int ONE =1; private int TWO = 2; private int THREE = 3; private int FOUR = 4; private void myMethod() { int myNewInt = FOUR+TWO; System.out.println("FOUR+TWO: " + myNewInt); } } This would become the following even with a new profile set with the properties above. Note: I've set "blank lines after fields to 0" because I want to manage spacing myself. public class MyClass { private int ONE =1; private int TWO = 2; private int THREE = 3; private int FOUR = 4; private void myMethod() { int myNewInt = FOUR+TWO; System.out.println("FOUR+TWO: " + myNewInt); } } Often, when I have complex field definitions of methods, I want to use spaces to organize the code ... but I can't now, and therefore Code Formatter ruins my entire file ... it worked fine up until 3.0M6, but M7 introduced the new formatter and I can't use it until this is remedied ... and it's a major annoyance to not be able to use code formatter. Am I missing a setting that I need to use, do the two that I'm using just not work, or should there be another property? Thanks Ben
Do not set this option. Preserve existing line breaks = true Put it to false. I will investigate.
Okay, taking out the "Preserve existing line breaks = true" made it work so I can use it ... interesting how I didn't come across that combination before. Thanks for the tip ... However, how is "Preserve existing line breaks = true" supposed to work then? Based upon the preview window it appears to be for keeping line breaks I've put in. For example, if I've put a line break in my comments, or something, is that not what it's supposed to do, keep it there? In any rate -- whether this is a user error, a bug, or just a weird difficult setup, thanks for your assistance, and perhaps what needs to be done is just add more default profiles, particularly the normal default being the same as M6 and earlier. And perhaps better explanations of certain attributes -- or behavior that is more inline with it's apparent description. Thanks.
I plan to get rid of the "preserve user line breaks" option. This option never worked the way people expect it to work. It simply preserve a line break where you had one. The problem is that this has huge side-effect on the wrapping line mecanism.
The option "preserve user line breaks" has been removed from the code formatter. It will be removed from the UI soon. Fixed and released in HEAD.
Verified for 3.0 using build I200403250010.