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 - Do not align assignments when they have other statements in between
Summary: Do not align assignments when they have other statements in between
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 12:01 UTC by SebastianZ
Modified: 2015-10-09 12:01 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 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