-
Notifications
You must be signed in to change notification settings - Fork 48
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
Indent dict keys wrongly if the keys are strings #32
Comments
I have the same problem here. Latest master, no changes to the .el file. |
This one is a real pain. I have to switch to clojure-mode whenever there's a file containing such a form. I'd call fixing this one a top priority. |
I've found where the bug occurs: In particular lines 789-790 in
Unfortunately this is a C function in |
I wonder how clojure-mode does it. Maybe we can detect a |
I've got a solution. Update
Indenting is working at various sexp depths. Now editing lisp-mode's source is clearly not the best approach. I'll see if I can due some advice-add magic to setup a PR for hy-mode.el. |
In the meantime you can find the fix at: https://github.com/ekaschalk/.spacemacs.d/blob/master/layers/langs/local/hy-indent-fix/hy-indent-fix.el Just load the file in your emacs config. |
https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned This is apparantly a known problem, the stackexchange links a robust solution for aligning with colons. We can see that common lisp's mode defines their own version of
Where it explicitly deals with the colon keyword indentation. So the solution is to write a modified |
Finally fixed, for lists as well. As compared to previous fix, doesn't fail on newlines, nor cause issues with the #@ with-decorator tag macro. |
I'm not sure if it's just my setup or a universal problem. But my emacs always indent a dict with the second string keys aligned to the first value part. For example:
From the example above you can see that the third (and later) keys are not affected.
The text was updated successfully, but these errors were encountered: