Author Topic: Beautify doesn't indent #ifndef/#else  (Read 2242 times)

b

  • Senior Community Member
  • Posts: 325
  • Hero Points: 26
Beautify doesn't indent #ifndef/#else
« on: August 20, 2018, 10:42:55 PM »
I was working on the beautify rules for the new company I'm at.   I noticed as I was setting up the for a new project that #ifdef/#else blocks would indent, but #ifndef/#else blocks do not.   E.g., the following block was the result after the beautify
Code: [Select]
#ifndef X
#define Y "blah"
#ifdef Z
#define A "foo"
#else
#define A "bar"
#endif
#else
#define A "baz"
#endif

I don't see anything beyond the preprocessor indent option that affects #ifndef/#else blocks.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Beautify doesn't indent #ifndef/#else
« Reply #1 on: August 21, 2018, 01:31:17 PM »
There's a rule for controlling the indent of the header guard #ifndef separately from the other preprocessing indent rules.  It looks like it's triggering here when it's not supposed to. It really should only count that as a header guard if it's in a header file, and the define after it was for X.  I'll take a look at it.  Thanks for the report.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Beautify doesn't indent #ifndef/#else
« Reply #2 on: August 21, 2018, 06:34:45 PM »
Fixed for the next beta drop.

b

  • Senior Community Member
  • Posts: 325
  • Hero Points: 26
Re: Beautify doesn't indent #ifndef/#else
« Reply #3 on: August 23, 2018, 04:37:29 PM »
Thanks!