Incorrect indentation on nested if-then-else expression

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

Result:
image

Editor settings:

Expected behavior

No level of indentation is added and the script is formatted as if the expression was surrounded by parentheses.

Hi,

Thanks for letting us know, we have added this to our bug queue and will address it as soon as we can.

1 Like