fix(indent/lua): wrong for nested tables due to branch on opening pairs

This commit is contained in:
Jędrzej Boczar 2022-04-06 21:14:56 +02:00 committed by Stephan Seitz
parent ab372a88ef
commit 717fef738b
3 changed files with 8 additions and 3 deletions

View file

@ -24,13 +24,10 @@
(function_call))) @dedent
[
"do"
"end"
"then"
"until"
"{"
"}"
"("
")"
"elseif"
(elseif_statement)

View file

@ -0,0 +1,7 @@
local a = {
{
{
1
},
},
}

View file

@ -38,5 +38,6 @@ describe("indent Lua:", function()
run:new_line("cond.lua", { on_line = 12, text = "x = x + 1", indent = 0 })
run:new_line("no-indent-after-paren-pairs.lua", { on_line = 3, text = "x = x + 1", indent = 0 })
run:new_line("no-indent-after-paren-pairs.lua", { on_line = 6, text = "x = x + 1", indent = 0 })
run:new_line("nested-table.lua", { on_line = 5, text = "{}", indent = 4 })
end)
end)