EmmyLuaCodeStyle
EmmyLuaCodeStyle copied to clipboard
Indentation of nested tables
trafficstars
Here are three tables that are indented like this using default settings:
aaa = { 111, {
222, {
333, {
444 } } } }
bbb = { 111,
{ 222,
{ 333,
{ 444 } } } }
ccc = {
111, {
222, {
333, {
444 } } } }
It's not so easy to recognize the structure of these tables, especially of aaa and ccc.
I would have expected something more like the following:
aaa = { 111, {
222, {
333, {
444 } } } }
bbb = { 111,
{ 222,
{ 333,
{ 444 } } } }
ccc = {
111, {
222, {
333, {
444 } } } }
The rules for this indentation are:
- If
{appears at the end of a line, then indent the next line relative to the first element of the outer group. - If
{starts a new line, then{shall have the same indentation as the first element of the same group.