-
Notifications
You must be signed in to change notification settings - Fork 119
Indentation of anonymous functions as arguments #29
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
Comments
Yes, it is possible to get the first form of indentation. In fact that is what should be the default, which means that is a bug I need to fix. Thanks for bringing this to my attention. I am a little busy with other things but I will make it a point to address this issue this week (along with some other open issues). |
Fantastic. Thanks for the great job maintaining an up-to-date php-mode :) |
I am looking into a more 'proper' way of adding these settings to php-mode without messing up any of the existing indentation rules, but in the mean time you could use this hook: (add-hook 'php-mode-hook
(lambda ()
(c-set-offset 'statement-block-intro '/)
(c-set-offset 'block-close -100))) I tried this against some of the files in the |
Thanks for the hook, but it messed up the indentation of code blocks for me. Now every code block after "{" are indented at level 0. // code at lvl1
if(x == y) {
// code is now at lvl0 :(
}
// code is back at lvl1 |
Ah, yes, I knew something was going to go wrong with that cheap hack of a hook, lol. I'm looking into a proper solution though while I brush up on the indentation engine of cc-mode, which php-mode uses. I forget how that system works as soon as I'm done working with it every time... |
Nice, no hurry though, as long as we know you know the issue ;) I really should pick up elisp and start hacking this stuff myself :P |
I'm not trying to toot my own horn, but something that helped me learn a lot about Elisp was to write a major mode from scratch, like https://github.com/ejmr/tup-mode This is also a good introduction: http://ergoemacs.org/emacs/elisp.html And of course in Emacs itself you have |
Thanks! I think writing an own major mode is a good start. Guess I'll just have to jump into it. |
This is now fixed as of v1.8 by ea5392c. |
emacs-php#29, emacs-php#42 This massively cuts back on the elisp code needed.
I am testing out the Slim framework and noticed an annoying indentation problem when supplying an anonymous function as an argument; I am using 2-spaces indentation I want my code to look like:
But it gets indented as.
Is is possible to achieve indentation as in the first example?
The text was updated successfully, but these errors were encountered: