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 255820 - Add option to control blank lines between cases in switch statement
Summary: Add option to control blank lines between cases in switch statement
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-09 06:55 UTC by SebastianZ
Modified: 2015-10-09 06:56 UTC (History)
0 users

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 SebastianZ 2015-10-09 06:55:50 UTC
There should be an option in Tools > Options > Editor > Formatting > PHP > Blank Lines that controls the number of blank lines between case and default blocks within switch statements.

So this:

switch($var) {
  case 0:
    echo 'foo';


  case 1:
    echo 'bar';
  default:
    echo 'baz';
}

with having the formatter set to 1 line between cases gets formatted as:

switch($var) {
  case 0:
    echo 'foo';

  case 1:
    echo 'bar';

  default:
    echo 'baz';
}

Sebastian