fxbois / web-mode

web template editing mode for emacs
https://web-mode.org
GNU General Public License v3.0
1.63k stars 262 forks source link

PHP array indentation still an issue #1268

Closed ahihi closed 1 year ago

ahihi commented 1 year ago

the issue described in https://github.com/fxbois/web-mode/issues/1249, https://github.com/fxbois/web-mode/issues/1212 is still happening with web-mode 17.3.8, producing results like

$x = [
    'a' => 0,
        'b' => 1,
        'c' => 2
];

$y = array(
    'a' => 0,
        'b' => 1,
        'c' => 2
);

function_call(
    $arg0,
        $arg1,
        $arg2
);

in particular, it occurs with the lineup-args indentation param being set to nil.

it seems the first element/argument after the opening bracket is indented as bracket-indentation, while the following ones are block-args, which causes the indentation level to increase when lineup-args is disabled.

fxbois commented 1 year ago

should be fixed with last commit

ahihi commented 1 year ago

it is indeed, thank you!