lua-fmt
lua-fmt copied to clipboard
comment is move to the wrong place
running formatText on these lines
function Test()
if a == 0 then
print("1")
-- a is one
elseif a == 1 then
print("2")
end
end
result is
function Test()
if a == 0 then
-- a is one
print("1")
elseif a == 1 then
print("2")
end
end
This also happens if you when you have a comment before the 'end' line of an if-else-end block.
Input:
if condition then
doStuff()
else
doOtherStuff()
--comment
end
Output:
if condition then
doStuff()
else
--comment
doOtherStuff()
end
another case I found Input:
if 1 then
doSomething()
-- comment
end
Result:
if 1 then
doSomething()
-- comment
end