lua-fmt icon indicating copy to clipboard operation
lua-fmt copied to clipboard

Functions declared after operators are indented in an odd way

Open AgentOttsel opened this issue 7 years ago • 0 comments

When I declare a function after an operator, like this:

local action = params.action or function()
    doStuff()
end

...lua-fmt formats it like this:

local action = params.action or function()
        doStuff()
    end

It seems like the more operators I add, the weirder the indentation gets. For example: Before:

local action = params.action or 1 and 1 and 2 or 5 and 10 and 2 + function()
    doStuff()
end

After:

local action = params.action or 1 and 1 and 2 or 5 and 10 and 2 + function()
                doStuff()
            end

AgentOttsel avatar Oct 15 '18 12:10 AgentOttsel