0

I want to setup matching behavior for Visual Studio and Uncrustify so that instant formatting was not modified later by Uncrustify.

I am almost there, but Uncrustify handles continued multiline expression excessively well. It aligns 2nd and other lines according to the first.

How can I make it put just a normal dumb indent on the lines after the first?

I looked through the full list of options here http://uncrustify.sourceforge.net/default.cfg with no success so far.

Uncrustify:

bool test(int a, int b, int c)
{
    return a == 1
           && b == 1
           && c == 1;
}

On the line with b and c there is an undesired alignment.

Visual Studio AutoFormat:

bool test(int a, int b, int c)
{
    return a == 1
        && b == 1
        && c == 1;
}

(If you wonder why I need Uncrustify, it's mostly because Uncrustify has indent_namespace_single_indent option and VS does not).

1 Answers1

0

Use this option to archive desirable behavior:

indent_single_after_return = true
Andrey Starodubtsev
  • 5,139
  • 3
  • 32
  • 46