Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luafmt over-indents nested tables #93

Open
GiovanH opened this issue Oct 3, 2021 · 0 comments
Open

luafmt over-indents nested tables #93

GiovanH opened this issue Oct 3, 2021 · 0 comments

Comments

@GiovanH
Copy link

GiovanH commented Oct 3, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant