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 227310 - Missing feature "preserve x number of empty lines"
Summary: Missing feature "preserve x number of empty lines"
Status: RESOLVED DUPLICATE of bug 106815
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal with 3 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-11 18:57 UTC by StanKurdziel
Modified: 2013-06-28 18:16 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description StanKurdziel 2013-03-11 18:57:27 UTC
Eclipse has a feature allowing the formatting spec to allow a certain number of blank lines.  Window->Preferences, Java->Code Style->Formatter, Edit Profile: Blank Lines tab, "Number of empty lines to preserve"

This allows the developer to format their code in the most readable manner, while still enforcing formatting rules.

A simple example is:

class Car {
  String name;

  @Getter
  Color color;  

  double rightWheelSpeed;
  double leftWheelSpeed;
}

Netbeans settings only allow forcing a space before or after ALL fields, or forcing no spaces between ALL fields. However, it's common java style to have groups of fields with no spaces inside the group and spaces between groups. In the example class above, it's much less readable to force a space between the right and left speed variables. It's also can be much less readable to remove the space above annotations for variables that have annotations.

Allowing the user to maintain up to a certain number of spaces (I've always had mine set to 1), without forcing those spaces, results in the most readable code, and prevents the desire to not use the formatter.
Comment 1 Michel Graciano 2013-05-21 19:37:03 UTC
It is one feature that I really would enjoy to see implemented :)
Comment 2 Michel Graciano 2013-06-28 17:57:08 UTC
Guys, it is already implemented for 7.4. There is two new options named 'Maximum Blank Lines' which already cover this issue IMO. Could someone close this, hopefully pointing to the fixed issue?
Comment 3 Michel Graciano 2013-06-28 18:16:13 UTC
Finally found it. Thanks Dusan :-)

*** This bug has been marked as a duplicate of bug 106815 ***