LuaFormatter icon indicating copy to clipboard operation
LuaFormatter copied to clipboard

chop_down_table and chop_down_kv_table not working

Open comedinha opened this issue 5 years ago • 4 comments

After last updates the functions chop_down_table and chop_down_kv_table is not working property. Tested with versions 1.3.1 and 1.3.3.

With:

column_limit: 250
indent_width: 2
tab_width: 2
continuation_indent_width: 2
chop_down_table: true
chop_down_kv_table: true

Input:

test = {
  image = "test",
  list = {
    {
      ref = "testRef",
      tags = { "tagTest" },
      time = 10,

      materials = {
        {
          materialId = 123,
          count = 10
        }
      },
    },
  },
}

Output:

test = {image = 'test', list = {{ref = "testRef", tags = {"tagTest"}, time = 10, materials = {{materialId = 123, count = 10}}}}}

If column limit is set to 80 the output is:

test = {
  image = 'test',
  list = {
    {
      ref = "testRef",
      tags = {"tagTest"},
      time = 10,
      materials = {{materialId = 123, count = 10}},
    },
  },
}

comedinha avatar Mar 19 '20 17:03 comedinha

It seems works well. Do you want the output that chop down each table regardless of the column limit?

Koihik avatar Mar 21 '20 14:03 Koihik

Believe that this is how the system could work, or adding a column_table_limit would be useful.

comedinha avatar Mar 23 '20 16:03 comedinha

I would also be interested in a column_table_limit . I have column_limit to 80 but I want to my tables content to always break no matter what. I find it hard to read when many values are packed on one line.

aganm avatar Apr 02 '20 14:04 aganm

@aganm @karanankit01 added this feature

tammela avatar May 13 '20 08:05 tammela