As of version 0.657, an if-then-else expression inside another if-then-else expression adds an extra level for every line after it. This does not occur if the nested if-then-else expression is surrounded by parentheses.
--!strict
local _cond = if 1
then if 2 then 3 else 4
else 5
--comment
local function _func()
--[[
owspamdcokie ok d
fwkroem kvf,ledp;s
]]
for i = 1, 5 do
local _ = '5'
end
repeat until false
end
Thanks for flagging this! This is a limitation of the current formatter, and the workaround is to use parentheses. We are planning a next-gen formatter and working on providing a better solution for this.
this isn’t a duplicate; where this report applies to nested if-then-else expressions and breaks indentation for everything after it, the other simply covers adding indentation for a single expression