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

Incorrect indentation of if when no parens are used #415

Open
Hi-Angel opened this issue Sep 12, 2021 · 2 comments
Open

Incorrect indentation of if when no parens are used #415

Hi-Angel opened this issue Sep 12, 2021 · 2 comments

Comments

@Hi-Angel
Copy link
Contributor

Steps to reproduce

  1. In rust-mode insert the code below:
    fn foo() {
        if (foo
            && bar) {
            true;
        }
    }
    fn foo() {
        if foo
            && bar {
                true;
            }
    }
    
  2. Try to indent it.

Expected

The line true in both paragraphs has the same offset

Actual

The line true has different offset in one and another paragraph

Additional information

Tested on 20210423 version in Elpa as well as the latest code in repo as of 494d59f commit.

@Hi-Angel
Copy link
Contributor Author

Hmm, I tried figuring out where's the problem, but I only have found if being handled once where it's added to rust-looking-back-symbols; and since it's being added together with while which has no indentation problem, the fact it doesn't work correctly looks very odd to me. No idea what could go wrong here.

@Hi-Angel
Copy link
Contributor Author

it's being added together with while which has no indentation problem

Oh wait, I take it back, the while has the exact same problem

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

No branches or pull requests

2 participants