How can I indent lambdas and initializer lists properly with clang-format?

32 Views Asked by At
lambda_indent("foo", "bar", []() {
    printf("baz");
});

initializer_list_indent("foo", "bar", {
                                          "baz",
                                      });

As shown in the code above, clang-format formats lambdas correctly, but not initializer lists. I want initializer lists to be formatted like this:

initializer_list_indent("foo", "bar", {
    "baz",
});

How can I change my .clang-format file to properly format initializer lists? Below is my current .clang-format file:

---
BasedOnStyle: LLVM
UseTab: Never
IndentWidth: 4
TabWidth: 4
BreakBeforeBraces: Attach
AllowShortIfStatementsOnASingleLine: true
ColumnLimit: 0
AccessModifierOffset: -4
NamespaceIndentation: All
FixNamespaceComments: false
AlignAfterOpenBracket: BlockIndent
BinPackArguments: false
BinPackParameters: false
SpaceBeforeCpp11BracedList: true
Cpp11BracedListStyle: false
0

There are 0 best solutions below