Skip to content

Commented out array elements break indentation #726

Closed
@flaviovs

Description

Correctly indented by php-mode:

<?php
$a = [
    'aaa' => [
        'bee' => 2,
    ],
    'foo' => [
         'bar' => 1,
    ],
    'lee' => 2,
];

Comment out an array element:

<?php
$a = [
    'aaa' => [
        'bee' => 2,
    ],
    // 'foo' => [
    //      'bar' => 1,
    // ],
    'lee' => 2,
];

Request auto-indentation (i.e., Tab over lines, indent-region, etc.):

<?php
$a = [
    'aaa' => [
        'bee' => 2,
    ],
    // 'foo' => [
        //      'bar' => 1,
        // ],
        'lee' => 2,
];
  • php-mode 20230103.1226
  • (php-enable-psr2-coding-style)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions