Skip to content

AlignAfterOpenBracket: DontAlign is ignored for nested function calls #56510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vitalif opened this issue Jul 13, 2022 · 3 comments
Open

AlignAfterOpenBracket: DontAlign is ignored for nested function calls #56510

vitalif opened this issue Jul 13, 2022 · 3 comments

Comments

@vitalif
Copy link

vitalif commented Jul 13, 2022

Hi

AlignAfterOpenBracket: DontAlign works fine with simple function calls. This is OK:

function_call(arg1, arg2,
              arg3, arg4);

is transformed to

function_call(arg1, arg2,
    arg3, arg4);

BUT it's ignored for nested function calls. This:

function_call(arg1, arg2, function_call2(arg3, arg4,
    arg5, arg6));

Is transformed to this:

function_call(arg1, arg2, function_call2(arg3, arg4,
                              arg5, arg6));

I.e. for nested function calls DontAlign counts ContinuationIndentWidth from the name of the nested function instead of counting it from the beginning of the line.

@vitalif
Copy link
Author

vitalif commented Jul 13, 2022

May be also related to #28052

@vitalif
Copy link
Author

vitalif commented Jul 13, 2022

Also there's a related question on stackoverflow but sadly with no answer
https://stackoverflow.com/questions/62157904/how-do-i-get-clang-format-to-align-arguments-in-nested-function-calls-by-the-roo

@llvmbot
Copy link
Member

llvmbot commented Jul 13, 2022

@llvm/issue-subscribers-clang-format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants