Author Topic: SlickEdit 25.0.1 C++ initializer list indents  (Read 299 times)

jnairb

  • Senior Community Member
  • Posts: 233
  • Hero Points: 11
SlickEdit 25.0.1 C++ initializer list indents
« on: April 08, 2021, 08:41:08 pm »
When I try to type initializers for a C++ class, SlickEdit keeps trying to indent the list when I don't want it. The first initializer is indented 3 spaces (my normal indent) and subsequent initializers are indented 2 more spaces. (Not sure where 2 comes from -- continuation indent is also 3.) SE 24 doesn't do this. I searched for a Formatting option to control this, but couldn't find one. Is there one that I missed?

FYI, this is what my preferred formatting is:
Code: [Select]
ABC::ABC()
: member1(0)
, member2(1)
{
   ...
}

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1535
  • Hero Points: 140
Re: SlickEdit 25.0.1 C++ initializer list indents
« Reply #1 on: April 09, 2021, 01:32:09 pm »
It looks like this was changed when some initializer list settings were added.  It does need a new setting to go back to the old indent behavior.  I'll take a closer look this afternoon.  I suspect it's not hot-fixable, but I should be able to to put it in for 25.0.2.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1535
  • Hero Points: 140
Re: SlickEdit 25.0.1 C++ initializer list indents
« Reply #2 on: April 27, 2021, 08:40:28 pm »
I've added a setting so you can get back to the previous behavior in the next fix release, v25.0.2.

Once that is released, you'll need to go into the formatting settings for C/C++, and under Indent -> Indent Rule Exceptions  turn "Indent leading initializer colon" "off".  Then editing will work like before, where
1) hitting ":" won't shift your indent out
2) hitting return after an initializer will put you in the same column the ":" was put in, instead of indenting in.