4

clang-format が作るもの:

 QObject::connect(&w, &sap::Window::keyPress, [&w](auto* event)
                 {
                     if(event->key() == Qt::Key_Escape)
                         w.close();
                 });

私が欲しいもの:

QObject::connect(&w, &sap::Window::keyPress, [&w](auto* event)
{
    if(event->key() == Qt::Key_Escape)
    w.close();
});

ラムダ体をインデントしないclang-formatを作成する方法はありますか? ドキュメントでそれについて何も見つけることができません。

これは私がこれまでに持っているものです:

BasedOnStyle: LLVM,
BreakBeforeBraces: Allman,
NamespaceIndentation: All,
SpaceBeforeParens: Never,
AccessModifierOffset: -4,

AllowShortIfStatementsOnASingleLine: false,
AllowShortBlocksOnASingleLine: false,
AllowShortFunctionsOnASingleLine: None,
AllowShortCaseLabelsOnASingleLine: false,
AllowShortLoopsOnASingleLine: false,

ColumnLimit: 100,
AlwaysBreakTemplateDeclarations: true,
PenaltyReturnTypeOnItsOwnLine: 9999,
IndentWidth: 4,
PointerAlignment: Left
4

2 に答える 2