Author Topic: B3: Indent 'if' of 'else if' option doesn't work  (Read 2563 times)

jnairb

  • Senior Community Member
  • Posts: 245
  • Hero Points: 11
B3: Indent 'if' of 'else if' option doesn't work
« on: May 15, 2013, 10:40:57 PM »
In the C/C++ Formatting options under Newlines/'if' Statements, I have "Indent 'if' of 'else if'" enabled and set to OFF. However it no longer works when entering code as it did in VS 17. For example:
Code: [Select]
   if (x == 1)
      something();
   else
      if ()

In VS17, after pressing enter following the 'else', the cursor is indented under the else, but when I type if<space>, the if is aligned with the else (and the '()'s added).  In VS18, the if remains indented. If I Beautify the code, then the 'if' is aligned with the else.

I don't normally have the Beautify while typing option turned on, but turning it on didn't help. (And I'd prefer to leave it off.)

I'm running the Windows x64 version on Windows 7.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: B3: Indent 'if' of 'else if' option doesn't work
« Reply #1 on: May 16, 2013, 01:32:20 PM »
That's very odd, because it doesn't look like the editing code ever looked at the option for "Indent if of 'else if".  I haven't looked deeply enough yet to figure out what intersection of options could have gotten you that behavior in v17.

I'll take a look at adding some code to honor that option.  Too late to get into this weeks drop, it would be in next week's drop at the earliest.

The indent not working while beautify-while-typing is on is a different issue, I'll take a look at that too.

Thanks for the report.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: B3: Indent 'if' of 'else if' option doesn't work
« Reply #2 on: May 17, 2013, 06:33:11 PM »
Update:  fix is going in for the next drop.  It wasn't half as mysterious as I thought, I was just overlooking something obvious.   ;D