Indentation inside of anonymous functions deletes code
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.
Deleting code, eessh... Thank you for the detailed bug report. I'm still out of town until tomorrow, but Wednesday I'll be devoting a block of time to working on this on some other recent PHP Mode issues. Sorry about the delay.
I don't think that it's that bad. My guess is that when no coding style is set, the default pear style isn't initialised properly. Fortunately I discovered that the WordPress style is closer to what I prefer, so I've set that now and my code continues to exist.
I confirm this bug. Is there a work around?
A temporary work around is to either use a different style besides pear via C-c . or manually enable the pear style if you want to use it.