Skip to content

clang-format: change the indentation of lambdas

Xaver Hugl requested to merge work/zamundaaa/change-formatting into master

Instead of indenting lambdas to the start of the lambda, always indent them to the start of the line, which is more consistent and easier to read

For example, before in !5452 :

    auto only32by9 = notPotentiallyBroken | std::ranges::views::filter([](const auto &mode) {
                         const double aspectRatio = mode->size().width() / double(mode->size().height());
                         return aspectRatio > 31 / 9.0 && aspectRatio < 33 / 9.0;
                     });
    const auto nativeSize = std::ranges::max_element(preferredOnly, [](const auto &n, const auto &nPlus1) {
        return n->size().width() < nPlus1->size().width();
    });

after:

    auto only32by9 = notPotentiallyBroken | std::ranges::views::filter([](const auto &mode) {
        const double aspectRatio = mode->size().width() / double(mode->size().height());
        return aspectRatio > 31 / 9.0 && aspectRatio < 33 / 9.0;
    });
    const auto nativeSize = std::ranges::max_element(preferredOnly, [](const auto &n, const auto &nPlus1) {
        return n->size().width() < nPlus1->size().width();
    });

Merge request reports