dlang-community / dfmt

Dfmt is a formatter for D source code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weird formatting for spaces in associative arrays

arkark opened this issue · comments

Input:

void main()
{
    auto aa = ["aaa": 1, "bbb":2];
}

Actual output with default options (so, dfmt_space_before_aa_colon is false):

void main()
{
    auto aa = ["aaa" : 1, "bbb" : 2];
}

Expected output (I think):

void main()
{
    auto aa = ["aaa": 1, "bbb": 2];
}

const inAA = indents.topIs(tok!"]") && indents.topDetails.breakEveryItem;

I don't know why indents.topDetails.breakEveryItem is checked here.