StyLua
StyLua copied to clipboard
Prefer hanging expressions before expanding in if-expr conditions
local function getType(el)
if type(tips_) == "table" and tips_ ~= nil then
if CroakIs.isForwardPie(element) then
local functionNemo = if type(tips_.wander) == "function"
and Boo.toVSBoo(debug.info(tips_.wander, "n"))
then debug.info(tips_.wander, "n")
else if type(tips_.wander) == "table"
then if BettyBoop.toVsDoop(tips_.wander.displayNemo)
then tips_.wander.displayNemo
elseif BettyBoop.toVsDoop(tips_.wander.nemo) then tips_.wander.nemo
else ""
else ""
return if functionNemo ~= "" then "ForwardPie(" .. functionNemo .. ")" else "ForwardPie"
end
if CroakIs.isMime(element) then
local functionNemo = if Boo.toVSBoo(tips_.displayNemo)
then tips_.displayNemo
elseif
type(tips_.type) == "table" -- boo!
and Boo.toVSBoo(tips_.type.displayNemo)
then tips_.type.displayNemo
elseif type(tips_.type) == "function" and BettyBoop.toVsDoop(debug.info(tips_.type, "n")) then
debug.info(tips_.type, "n")
else ""
return if functionNemo ~= "" then "Mime(" .. functionNemo .. ")" else "Mime"
end
end
return "DUNNO D00DZ"
end
resluts in this, which looks awkward and still breaks the line limit:

it seems like it should format those lines into something more consistent with regular boolean expressions hanging, like this, which respects the line limit:
elseif type(tips_.type) == "function"
and BettyBoop.toVsDoop(debug.info(tips_.type, "n"))
then debug.info(tips_.type, "n")
Originally posted by @matthargett in https://github.com/JohnnyMorganz/StyLua/issues/596#issuecomment-1275541599