-
Notifications
You must be signed in to change notification settings - Fork 302
Indentation for closing parentheses is incorrect #443
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
Comments
Related issue/probably a duplicate (though with less info): #442 |
yorickpeterse
added a commit
to yorickpeterse/rust.vim
that referenced
this issue
May 20, 2021
To help explain this problem, consider this input (where | is the cursor): foo(|) Prior to this commit, pressing Enter would result in the following: foo( |) That is, the closing parenthesis is indented by one level. This is the case regardless of the cindent options/keys chosen. To fix this, we manually indent lines that start with a ")" (ignoring leading whitespace). Such lines are indented according to the indentation of the line that contained the opening parenthesis. Fixes rust-lang#443
yorickpeterse
added a commit
to yorickpeterse/rust.vim
that referenced
this issue
May 20, 2021
To help explain this problem, consider this input (where | is the cursor): foo(|) Prior to this commit, pressing Enter would result in the following: foo( |) That is, the closing parenthesis is indented by one level. This is the case regardless of the cindent options/keys chosen. To fix this, we manually indent lines that start with a ")" (ignoring leading whitespace). Such lines are indented according to the indentation of the line that contained the opening parenthesis. Fixes rust-lang#443
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When entering a newline inside parentheses, the closing parentheses is indented one level too far. Consider this example (
|
is the cursor position):When pressing enter, the result is this:
But the expected result was this:
In other words: the closing
)
has the same indent level as the first non-spacecharacter of the line that contains the
(
it belongs to.Steps to reproduce
First, install vim-plug. Next, create
/tmp/mini.vim
with the followingcontents:
Then start Vim and run
:PlugInstall
, then reopen Vim. Next, runset ft=rust
.In the buffer, type
foo()
, then move the cursor inside the parentheses likeso:
Now press enter and observe how the closing
)
is indented one level, insteadof not being indented at all.
Debug info
The text was updated successfully, but these errors were encountered: