trixnz / lua-fmt

lua-fmt is pretty-printer for Lua code
MIT License
189 stars 25 forks source link

lua-fmt requires multiple runs to format a Lua file due to inline table #26

Open henriquegemignani opened 6 years ago

henriquegemignani commented 6 years ago

The following code:

explodeEmitter:addOnCompleteToEmmiter({ callback = function() notify("kIceExplosionFinished") end })

Gets formatted into this:

explodeEmitter:addOnCompleteToEmmiter(
    {callback = function()
            notify("kIceExplosionFinished")
        end}
)

That when formatting again, returns this:

explodeEmitter:addOnCompleteToEmmiter(
    {
        callback = function()
            notify("kIceExplosionFinished")
        end
    }
)

Running lua-fmt via vscode-lua 0.12.4