Clang-format array initializer one per line

Viewed 292

Clang-format, given an array of structs with initializers, is putting two items per line:

sym keywords[] = {
    {0, 0, "C"},           {0, 0, "T"},
    {0, 0, "V"},           {0, 0, "ax"},
    {0, 0, "bool"},        {0, 0, "break"},
    ...
    {0, 0, "val"},         {0, 0, "vector"},
    {0, 0, "version"},     {0, 0, "void"},
    {0, 0, "while"},
};

How can I get it to just put one item per line?

clang-format, array initialisers is the closest I have been able to find to a discussion of this problem, but neither of the proposed solutions has any effect; Cpp11BracedListStyle: false does the same thing except with extra spaces between the braces, and as you can see in the above, making sure there is a comma after the last item, doesn't help.

0 Answers
Related