StyLua
StyLua copied to clipboard
`collapse_simple_statement` collapses functions inside conditionals
If you have collapse_simple_statement for conditionals and you add a function as the statement
if bar then
return function()
foo()
end
end
it will collapse the function as it's considering the function as a simple statement. So it ends up like this:
if bar then return function()
foo()
end end
This will also happen if the function is provided as an argument
this:
if bar then
return Array.filter({}, function()
return true
end)
end
formats like this:
if bar then return Array.filter({}, function()
return true
end) end
Probably functions shouldn't be considered as a simple statement