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 255836

Summary: Do not align assignments when they have other statements in between
Product: php Reporter: SebastianZ
Component: Formatting & IndentationAssignee: Ondrej Brejla <obrejla>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description SebastianZ 2015-10-09 12:01:15 UTC
When you have checked Tools > Options > Editor > Formatting > Alignment > Assignment, code like

$a = 1;
$abc = 2;
exampleFunction();
$foobar = 'baz';
$someVariable = 3;

will be formatted as

$a            = 1;
$abc          = 2;
exampleFunction();
$foobar       = 'baz';
$someVariable = 3;

Instead the formatter should only align contiguous assignments. I.e. the result would then be:

$a   = 1;
$abc = 2;
exampleFunction();
$foobar       = 'baz';
$someVariable = 3;

This is especially relevant when there are more than one non-assignment statements in between.

Sebastian