Author Topic: Indent Style for C/C++  (Read 5495 times)

PlasticJesus

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Indent Style for C/C++
« on: October 17, 2019, 07:57:48 PM »
Argh.
Our company standard formatting is as follows:

void Foo::Bar()
{
  int i;
  for(i = 0;x < 10;x++)
    {
      // a comment
      printf("i am %d\n", i);
      // another comment
    }
}


So... two spaces before the brace, and two spaces on the line following the brace.

By setting Brace Style/Statement Style to 'Next Line Indented', I have gotten this far:

void Foo::Bar()
{
  int i;
  for(i = 0;x < 10;x++)
    {
    // a comment
    printf("i am %d\n", i);
    // another comment
    }
}


So now, I just need the stuff inside the braces (statement body) indented. I would think this would be in Indent/General, but it aint.
Please help.

Thanks!