emacs.d icon indicating copy to clipboard operation
emacs.d copied to clipboard

Closing bracket not indented correctly in Rust mode

Open RawFisher opened this issue 2 years ago • 7 comments

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

图片

My emacs version is emacs28.1 I work on macOS

RawFisher avatar Aug 20 '22 11:08 RawFisher

What's your major-mode?

redguardtoo avatar Aug 21 '22 12:08 redguardtoo

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...

phye avatar Aug 24 '22 14:08 phye

What's your major-mode?

rust-mode

RawFisher avatar Aug 24 '22 14:08 RawFisher

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 avatar Aug 24 '22 14:08 RawFisher

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

RawFisher avatar Aug 24 '22 15:08 RawFisher

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

redguardtoo avatar Aug 25 '22 06:08 redguardtoo

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.

redguardtoo avatar Aug 25 '22 06:08 redguardtoo