dominikh / go-mode.el

Emacs mode for the Go programming language
BSD 3-Clause "New" or "Revised" License
1.37k stars 209 forks source link

Does not align closing parenthesis #379

Closed ChoppinBlockParty closed 1 year ago

ChoppinBlockParty commented 3 years ago

Not sure if it is this plugin responsibility or some generic emacs configuration.

if myvar {
    } 

Expect the closing parenthesis to be on the same indentation level as if. It works find for other languages I work with, e.g. C++, javascript.

psanford commented 3 years ago

This should work fine. What version of emacs are you using?

Can you try a minimal emacs config file where you only load go-mode and see if that works?

psanford commented 3 years ago

Are other things indenting correctly or is nothing getting the proper indentation level?

ChoppinBlockParty commented 3 years ago

I found out it is due to newline-and-indent. I bound ret to it, works in most major modes. Frankly, I do not remember why I did this, probably there was a reason.

muirdm commented 3 years ago

Instead of newline-and-indent, maybe turn on electric-indent-mode? Even if you keep using newline-and-indent, electric-indent-mode may still resolve the problem.

ChoppinBlockParty commented 3 years ago

I actually have electric-indent-mode enabled. Still experience the problem. ret is binded to newline.

muirdm commented 3 years ago

Can you create a minimal Emacs config that reproduces the issue?

dominikh commented 1 year ago

This issue has stalled. I'll reopen it if the asked-for information is provided.