Skip to content

Indentation inside of anonymous functions deletes code #132

Open
@alanpearce

Description

@alanpearce

When indent-tabs-mode is enabled and a tab-width of 4, trying to indent a statement inside an anonymous function deletes some characters.

foo(function ($bar) {
    test('baz');
});

With the cursor before test, pressing tab changes the line to

foo(function ($bar) {
t('baz');
});

The number of characters deleted seems to depend on the value of tab-width. With the brace on a newline, the problem doesn't occur

foo(function ($bar)
{
    test('baz');
});

php-mode-coding-style is pear, but not set in my configuration, so it's just using the default. Running php-enable-pear-coding-style manually, then enabling indent-tabs-mode again seems to fix the issue in the buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions