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 highlighting on conditional expression after line continuation #340

Open
matthewd opened this issue Apr 10, 2017 · 1 comment
Open
Assignees

Comments

@matthewd
Copy link

In the following code, the else and end are highlighted as belonging to the def: the if appears to be treated as a modifier despite being in an expression context.

def foo
  x = \
    if a
      1
    else
      2
    end
end

Indentation seems to be correspondingly mislead, too.

@tpope
Copy link
Member

tpope commented Apr 10, 2017

Patch welcome, but my fix would be just to delete that worthless backslash.

@dkearns dkearns self-assigned this Feb 22, 2019
dkearns added a commit that referenced this issue Feb 25, 2019
Conditional and loop modifiers always appear after required line
continuations so match the redundant ones and allow the general forms to
match as normal.

Adds a user configuration variable, ruby_line_continuation_error, to
highlight useless line continuations as errors.

Addresses the syntax highlighting component of #340.

Because you have to be more than a little mad to be doing this in the
first place.
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

3 participants