Skip to content

Certain tokens are not taken into account when counting column width #282

@archiif

Description

@archiif

I set my column width to 88 and these two table keys occupies exactly 88 chars + 1 char from the last comma separating the keys.

a = {
    key1 = string.format("test", "test", "test", "test", "test", "test", variable_names),
    key2 = string.format("test", "test", "test", "test", "test", "test", variable_names),
}

But stylua doesn't chop down the arguments like it is supposed to, so it seems that the comma isn't taken into account when calculating the column width.

If you extend the arguments like this:

a = {
    key1 = string.format(
        "test",
        "test",
        "test",
        "test",
        "test",
        "test",
        variable_names_
    ),
    key2 = string.format(
        "test",
        "test",
        "test",
        "test",
        "test",
        "test",
        variable_names_
    ),
}

stylua will chop them down properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions