emacs-php / php-mode

A powerful and flexible Emacs major mode for editing PHP scripts
GNU General Public License v3.0
580 stars 118 forks source link

Commented out array elements break indentation #726

Closed flaviovs closed 1 year ago

flaviovs commented 1 year ago

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,
];
zonuexe commented 1 year ago

@flaviovs Thank you for reporting, maybe fixed in #732.

flaviovs commented 1 year ago

Hi @zonuexe,

I confirm, after upgrading to latest on MELPA (20230305.2120) the issue is gone.

Thank you