Skip to content

never seems to indent anonymous functions properly when used as pars to another function (higher order function) #19

@RichardEllicott

Description

@RichardEllicott

it can NEVER seem to handle anonymous functions like:

if pcall(function ()
print('test1')
error()
end)then
print('test2')
else
print('test3')
end

this is how lua format will make this look, making all the subsequent nesting screw up:

https://gist.github.com/Ri…/ceb10fd1ed1ce1691756bda96699342a

thank god this actually formats okay mind:

tableOhFunctions = {
thingy1 = function ()
print('blah')
end,
thingy2 = function ()
print('blah')
end,
}

so long as i make sure them "end" statements go on the next lines

However, since "pcall" with an anonymous function is lua's equivalent to try and catch, this is driving me crazy!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions