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
I've found some unexpected indentations such as following examples.
Example 1
Before
After
Example 2
Before
In this case, no indent will be executed.
Example 3
Meanwhile, it will be indented correctly if the codes are as following.
Before
After