which Uncrustify setting replaces blank lines with indenting spaces?

952 Views Asked by At

I've done a number of read-thrus of my Uncrustify settings page over the past couple days but haven't found the setting. Perhaps a second pair of eyes knows what I am missing.

In my source code, the blank lines within functions are getting replaced by indenting spaces.

For example (the two blank lines there are simply just returns):

int foo()
{

    return 1;

}

turns into:

int foo()
{
____    
    return 1;
____
}

(well, the "_" you see there are actually blank spaces)

Which Uncrustify setting controls this behavior?

2

There are 2 best solutions below

1
On

I had this same problem, and figured it out. It's not Uncrustify doing this, it's actually XCode.

If you run Uncrustify outside of XCode, it will not insert the blank tab/spaces on the blank line (and if they are there it will actually remove them).

Discovering this, I found out that it's the XCode preference "Automatically indent based on syntax" setting that when enabled (and it's enabled by default), will insert the spaces on blank lines after Uncrustify runs.

To answer your question, I never figured out which Uncrustify setting removes the blank spaces, but I can tell you, that with my default Uncrustify config file, it did remove the indenting spaces on the blank lines.

Here's the XCode setting in XCode (5.0.2) xcode screenshot

0
On

In case any future readers are struggling with this the option is indent_single_newlines.