-
Notifications
You must be signed in to change notification settings - Fork 46
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
Newline not indenting #153
Comments
It's on purpose regarding Here is
I don't think current nim-mode's auto indent can handle nim's all situations. |
Thanks for closing my issue for me. Would have been nice if we discussed this first, though. What is the relevance of If nim-mode's auto indent is insufficient as you claim, then why not fix it instead of hand-waving the issue away? It seems like you admitted that it is insufficient and that there is work to be done here. Not to mention that the grammar of Nim is pretty well-defined already so the fix should fall into place on its own. Maybe it's just easier to close this issue and pretend it doesn't exist? Is it really "on purpose" that we should be hitting RET + TAB every single time when I've never encountered this in any other major mode? Let me know if you still need clarification. And don't close issues prematurely, please. |
Sorry, I misinterpreted that your "C-M-j" to "C-j". Let's me clarify; it's on purpose to just insert a newline by hitting return key and C-j to "insert a newline and indent", which was Emacs' default way before electric-indent was introduced. Are you sure that you need to hit "C-M-j"? |
well what works for me is this:
I have no idea how ideomatic that solution is though. From the description of that function, it seems to be pretty much what you want in all major modes, that's why I put it to global. |
@yuutayamada I understand that Emacs worked a bit differently once not too long ago, but nowadays every major mode I've used will auto-indent when hitting RET. I'm trying C-j but it does not work for me - it seems identical to RET in the modes I've tried (nim, python, haskell, and c++). Yes, C-M-j seems to auto-indent despite being intended for comments (based on its name, @krux02, you can also use this if you only want to affect nim-mode:
[Sorry, just saw your edit. Maybe the above will be useful for somebody though.] |
@m-cat So, please for now, use your way. I think it's no harm if you just want to swap RET and C-j. |
There seem to be at least two problems with nim-mode's configuration of electric-indent-mode. One of them is already described in issue #151. The other one, which I'm surprised hasn't been mentioned yet, is that newlines seem to ignore electric-indent-mode. The correct behavior should be that pressing
<RET>
automatically indents to the current indentation level. Instead, I have to either press<RET> + <TAB>
orC-M-j
every time. You can compare the behavior to python-mode where newlines are automatically indented.I've observed this issue in both Emacs 24 and the newest snapshot (Emacs 26) and confirmed it's not caused by any of my personal configuration.
The text was updated successfully, but these errors were encountered: