Author Topic: Format style...?  (Read 2070 times)

joecar

  • Senior Community Member
  • Posts: 424
  • Hero Points: 9
  • engineer/gearhead
Format style...?
« on: January 23, 2019, 06:31:34 PM »
How would I configure formatting to support the following indent style:

Code: [Select]
          if (CurrentPage() != AAAA)
            {
              SetCurrentPage(AAAA);
            }
          else
            {
              SetCurrentPage(PreviousPage());
            }


( notice the double indenting )

That is the surrounding style (and I have to maintain it).

Thanks.


SE 23.0.0.11 with hotfix 2

joecar

  • Senior Community Member
  • Posts: 424
  • Hero Points: 9
  • engineer/gearhead
Re: Format style...?
« Reply #1 on: January 23, 2019, 06:32:56 PM »
same with while() and for()...

Code: [Select]
  while(x)
    {
      xxx();
    }

joecar

  • Senior Community Member
  • Posts: 424
  • Hero Points: 9
  • engineer/gearhead
Re: Format style...?
« Reply #2 on: January 23, 2019, 06:35:46 PM »
In particular, notice difference between single statement and block:

Code: [Select]
      if(aaaa)
        break;
      if(bbbb)
        {
          x=atoi(y);
          check(pid, procname);
        }


joecar

  • Senior Community Member
  • Posts: 424
  • Hero Points: 9
  • engineer/gearhead
Re: Format style...?
« Reply #3 on: January 23, 2019, 06:37:59 PM »
Switch statements:
Code: [Select]
  switch (x)
  {
    case 1:
      aaaa();
      bbbb();
      break;
    default:
      break;
  }



joecar

  • Senior Community Member
  • Posts: 424
  • Hero Points: 9
  • engineer/gearhead
Re: Format style...?
« Reply #4 on: January 23, 2019, 07:22:07 PM »
Switch also appears like this:

Code: [Select]
  switch (x)
    {
      case 1:
        aaaa();
        bbbb();
        break;
      default:
        break;
    }


patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Format style...?
« Reply #5 on: January 24, 2019, 02:24:40 PM »
The indented brace style supports the Whitesmith style indented braces, but not the GNU style where the code inside the braces is indented.  It's been on our list, but it's also been pretty low priority so far.

joecar

  • Senior Community Member
  • Posts: 424
  • Hero Points: 9
  • engineer/gearhead
Re: Format style...?
« Reply #6 on: January 24, 2019, 05:41:51 PM »
I'm at a new job, the code style here is as above, using GCU C, in embedded controllers... reams and reams of code... I'm going to need help keeping the style intact  ;) ;) ;) ;)