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

"if" in comment can mess up indentaction #479

Open
bendk opened this issue Jun 23, 2022 · 0 comments
Open

"if" in comment can mess up indentaction #479

bendk opened this issue Jun 23, 2022 · 0 comments

Comments

@bendk
Copy link

bendk commented Jun 23, 2022

Steps to reproduce:

  • Edit a file with "If" inside a comment, on an indented line (I believe "fn" will also trigger the issue)
  • Begin and end any block

Expected behavior: The comment shouldn't affect indenting
Actual behavior: The } char will be indented to match the indent of the comment line. Note the leading space in the example below:

/**
 * Something is wrong if rust.vim adds indent to the last line
 */

struct Foo {
 }

I believe this is due to this line, which doesn't take into account if a line is a comment or not: https://github.com/rust-lang/rust.vim/blob/master/indent/rust.vim#L148-L149

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

1 participant