Author Topic: C++ Beautifier and Constructors with initializers  (Read 368 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2158
  • Hero Points: 191
  • Text
C++ Beautifier and Constructors with initializers
« on: August 28, 2020, 05:00:36 pm »
Unlike in Options, in Beautifier settings tree there isn't a right-click menu to "Copy Options Path"

But, the real reason for this post: There isn't an option to control new lines around ":".
There is an option to add spaces.

Given:
Code: [Select]
class Abc : public Xyz
{
public:
    Abc() : m_Buffer(0), m_End(0), m_Count(0)
    {
    }
}

I typically like to have 1 initializer per line, all lined up nicely
Code: [Select]
    Abc()
    :   m_Buffer(0),
        m_End(0),
        m_Count(0)
    {
    }

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1468
  • Hero Points: 131
Re: C++ Beautifier and Constructors with initializers
« Reply #1 on: August 28, 2020, 05:14:59 pm »
Seems simple enough.  Not sure if I'll get to it for the beta, but I'll take a look at adding an option for that.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1468
  • Hero Points: 131
Re: C++ Beautifier and Constructors with initializers
« Reply #2 on: December 10, 2020, 09:00:49 pm »
Settings for this will be in the v25.0.1 point release.

Under Newlines -> Statements And Declarations -> Constructor initializer lists, there are two new settings "Force one initializer per line" and "Force colon on new line".  You'll want to set both of those to "on" for the formatting you want. 

jporkkahtc

  • Senior Community Member
  • Posts: 2158
  • Hero Points: 191
  • Text
Re: C++ Beautifier and Constructors with initializers
« Reply #3 on: December 10, 2020, 11:53:13 pm »
Thanks!