I use php-mode in Emacs, it work fine execept when I use closures as argument like this:
$app->get('/', function() use ($app) {
echo "foo";
});
It seams that when function is inside function invocation the indentation is doubled. How to fix this?
EDIT
How to make it look like this (the same as javascript-mode handle anonymous functions).
$app->get('/', function() use ($app) {
echo "foo";
});
With help from @amalloy I manage to create this fix that solve the problem:
not sure If it need to be in php-mode-hook or not
Great help was
C-c C-s
that show what will be inc-syntactic-context
variable whenc-special-indent-hook
is fired (and it's after indent was done).CC-Mode Manual also help
UPDATE
I found this code that is invalid
(dots are the spaces that need to be removed)
and another one
so I need to modify the function,
C-c C-s
shows thatarglist-cont-nonempty
appear twice (each additionalarglist-cont-nonempty
add more indent that need to be removed)