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

Unexpected Indentation #96

Open
veracosta opened this issue Jul 31, 2015 · 0 comments
Open

Unexpected Indentation #96

veracosta opened this issue Jul 31, 2015 · 0 comments

Comments

@veracosta
Copy link

I've found some unexpected indentations such as following examples.

Example 1

Before

foo = "bar"
if /^.*(foo)/.match("foo")
case foo
when /1/
puts "foo"
when /2/
puts "bar"
end
end

After

foo = "bar"
if /^.*(foo)/.match("foo")
case foo # Not indented.
when /1/
  puts "foo"
  when /2/  # Not unindented.
  puts "bar"  # Not indented.
end
end

Example 2

Before

foo = "bar"
if /^.*(foo)/.match("foo")
case foo
when 1
puts "foo"
when 2
puts "bar"
end
end

In this case, no indent will be executed.

Example 3

Meanwhile, it will be indented correctly if the codes are as following.

Before

foo = "bar"
if /^.*(foo)bar/.match("foo") # Added a string after parentheses
case foo
when 1
puts "foo"
when 2
puts "bar"
end
end

After

foo = "bar"
if /^.*(foo)bar/.match("foo")
  case foo
  when 1
    puts "foo"
  when 2
    puts "bar"
  end
end
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