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

Comment indentation is always changed #3254

Closed
mqudsi opened this issue Dec 16, 2018 · 0 comments · Fixed by #3833
Closed

Comment indentation is always changed #3254

mqudsi opened this issue Dec 16, 2018 · 0 comments · Fixed by #3833

Comments

@mqudsi
Copy link

mqudsi commented Dec 16, 2018

With both normalize_comments and wrap_comments disabled, the following code is mangled:

fn foo {
    let f = bar(); // comment for this line
    // some comment here to describe the next line
    let b = baz();
}

Which gets "corrected" to the following:

fn foo {
    let f = bar(); // comment for this line
                   // some comment here to describe the next line
    let b = baz();
}

Also,

fn foo {
    let f = bar(); // comment for this line
    // let b = baz();
}

Gets equally transformed to

fn foo {
    let f = bar(); // comment for this line
                   // let b = baz();
}

Note that I expect neither wrap_comments nor normalize_comments to do this.

Suggested fix: if the comment on the next line starts at index 0, do not try to align them.
See also #2949, which was fixed.

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

Successfully merging a pull request may close this issue.

2 participants