Skip to content

Add another case where cindent is correct #13600

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

Merged
merged 1 commit into from
Apr 18, 2014
Merged

Conversation

brandonw
Copy link
Contributor

When calling a function, or anything with nested parens,
default to cindent's indent. The least error-prone way I
could think of identifying this is to look for a line
that ends with a ',', as well as a non-zero number of
any character except parens before the comma, and
then an open paren.

This will overlap with the previous rule accounting for
function definitions, but that should be fine because
it is also using cindent.

When calling a function, or anything with nested parens,
default to cindent's indent. The least error-prone way I
could think of identifying this is to look for a line
that ends with a ',', as well as a non-zero number of
any character except parens before the comma, and
then an open paren.

This will overlap with the previous rule accounting for
function definitions, but that should be fine because
it is also using cindent.
bors added a commit that referenced this pull request Apr 18, 2014
When calling a function, or anything with nested parens,
default to cindent's indent. The least error-prone way I
could think of identifying this is to look for a line
that ends with a ',', as well as a non-zero number of
any character except parens before the comma, and
then an open paren.

This will overlap with the previous rule accounting for
function definitions, but that should be fine because
it is also using cindent.
@bors bors closed this Apr 18, 2014
@bors bors merged commit 59f3414 into rust-lang:master Apr 18, 2014
chris-morgan added a commit to chris-morgan/rust that referenced this pull request Apr 24, 2014
The change in rust-lang#13600 was incorrect, containing a bad regular expression;
inside an indent function, errors are silently ignored (and the ``~=``
operation will return 0), so it just always failed, causing the cases
that were supposed to be caught to not be caught and making things like
the ``match`` example shown above or struct field definitions regress.

I have fixed the regular expression to what it should have been. This is
still imperfect, of course, not handling cases like where the first
argument to a function is a function call (``foo(bar(),``), but it'll do
for now.
bors added a commit that referenced this pull request Apr 24, 2014
The change in #13600 was incorrect, containing a bad regular expression;
inside an indent function, errors are silently ignored (and the ``~=``
operation will return 0), so it just always failed, causing the cases
that were supposed to be caught to not be caught and making things like
the ``match`` example shown above or struct field definitions regress.

I have fixed the regular expression to what it should have been. This is
still imperfect, of course, not handling cases like where the first
argument to a function is a function call (``foo(bar(),``), but it'll do
for now.

----

I have a general request to make of reviewers about any changes made to `src/etc/vim`: **please tell me**. As a general rule I want to review them. (I’ll make an exception for changes the prelude; it needs fixing from time to time when some people don’t update the syntax file, anyway.)

cc @brandonw
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 7, 2024
…rednet

borrow_deref_ref: do not trigger on `&raw` references

changelog: [`borrow_deref_ref`]: do not trigger on `&raw` references

Fix rust-lang#13584
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 21, 2024
…rednet

borrow_deref_ref: do not trigger on `&raw` references

changelog: [`borrow_deref_ref`]: do not trigger on `&raw` references

Fix rust-lang#13584
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

Successfully merging this pull request may close these issues.

3 participants