Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newline between array values breaks indentation #793

Closed
cweiske opened this issue Dec 6, 2024 · 2 comments · Fixed by #801
Closed

Newline between array values breaks indentation #793

cweiske opened this issue Dec 6, 2024 · 2 comments · Fixed by #801

Comments

@cweiske
Copy link
Contributor

cweiske commented Dec 6, 2024

When a multi-line array contains an empty line, automatic indentation of the element after the newline is wrong (press tab on the baz line):

<?php
return [
    'foo' => 'bar',

        'baz' => 'bat'
];

The baz line should be indented by 4 spaces and not 8.

This problem appears in the following styles (C-c .):

  • psr2
  • symfony2
  • drupal
  • pear

Problem does not appear in:

  • wordpress
  • php

Related: #726
php-mode 20241024.1241
emacs 28.2

@zonuexe
Copy link
Member

zonuexe commented Jan 9, 2025

@cweiske Thank you for reporting this issue. I believe it's already resolved in #801.

@cweiske
Copy link
Contributor Author

cweiske commented Jan 12, 2025

I've updated to php-mode 20250109.2103, but the problem still occurs.
I don't know if the fix should be in this version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants