dansanderson/picotool

luafmt over-indents nested tables

GiovanH opened this issue · 0 comments

Input:

local a_complex_table = {
  1, 2, {
  'a', 'b', 'c'
}}

add(a({{{{
  1
}}}}))

Command: p8tool luafmt carts/untitled_3.p8 --indentwidth 2

Expected output: no change

Actual output:

local a_complex_table = {
  1, 2, {
    'a', 'b', 'c'
  }}

add(a({{{{
            1
          }}}}))

Luafmt seems to be indenting to the inner width rather than the outer width, and so is over-spacing tables. This likely applies to non-table nested structures as well.