redguardtoo / emacs.d

Fast and robust Emacs setup.
http://blog.binchen.org
GNU General Public License v3.0
2.39k stars 619 forks source link

Closing bracket not indented correctly in Rust mode #996

Open RawFisher opened 1 year ago

RawFisher commented 1 year ago

When I am writing rust code, I found closing bracket not indented correctly.

图片

My emacs version is emacs28.1 I work on macOS

redguardtoo commented 1 year ago

What's your major-mode?

phye commented 1 year ago

Maybe this is a duplication of https://github.com/redguardtoo/emacs.d/issues/975

Seems no updates from upstream, just wonder if they're using emacs 28 to write any code using c derived mode...

RawFisher commented 1 year ago

What's your major-mode?

rust-mode

RawFisher commented 1 year ago

Maybe this is a duplication of #975

Seems no updates from upstream, just wonder if they're using emacs 28 to write any code using c derived mode...

You are right. Now I found the same problem appear in c mode...Maybe I should use older version of emacs?

RawFisher commented 1 year ago

When I delete all config files, and then

  1. M-x package-refresh-contents
  2. M-x package-install rust-mode
  3. create a .rs file
  4. enable electric-pair-mode Closing bracket can indent correctly image
redguardtoo commented 1 year ago

I can reproduce the issue after removing my emacs.d and follow your steps,

image
redguardtoo commented 1 year ago

You could turn off electric-pair-mode or run some indent command manually or automatically in after-save-hook.

I run evil-indent manually to re-format the code.