Skip to content

clang-format LambdaBodyIndentation incorrectly work with custom IndentWidth and UseTab option #128016

Open
@Childcity

Description

@Childcity
  • clang-format: 13.0 or higher.
  • reproduced on 19.1.7 / 21.0.0

LambdaBodyIndentation doesn't work correctly with the following config:

LambdaBodyIndentation: Signature
ColumnLimit: 100
IndentWidth: 4
TabWidth: 4
UseTab: ForIndentation

Steps To Reproduce:

  • Save test.cpp
    void foo() {
    	auto it =
    	    std::find_if(list.cbegin(), list.cend(), [config](const FooBazzBarrAaaaFooBazzBar &other) {
    		    return other->isEqual(config);
    	    });
    }
  • Run clang-format.exe -i -style='{LambdaBodyIndentation: Signature, ColumnLimit: 100, IndentWidth: 4, TabWidth: 4, UseTab: ForIndentation}' "D:\test.cpp"

Expected Result

Actual Result

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions