Skip to content
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

Closing bracket not indented correctly in Rust mode #996

Open
RawFisher opened this issue Aug 20, 2022 · 7 comments
Open

Closing bracket not indented correctly in Rust mode #996

RawFisher opened this issue Aug 20, 2022 · 7 comments

Comments

@RawFisher
Copy link

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

图片

My emacs version is emacs28.1
I work on macOS

@redguardtoo
Copy link
Owner

redguardtoo commented Aug 21, 2022

What's your major-mode?

@phye
Copy link
Contributor

phye commented Aug 24, 2022

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

@RawFisher
Copy link
Author

What's your major-mode?

rust-mode

@RawFisher
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

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

@redguardtoo
Copy link
Owner

redguardtoo commented Aug 25, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants