Author Topic: 24.0.1 - C/C++ wrong indent  (Read 1161 times)

frankfoxy

  • New Community Member
  • Posts: 1
  • Hero Points: 1
24.0.1 - C/C++ wrong indent
« on: January 21, 2020, 03:05:38 AM »
For following code block:
Code: [Select]
std::vector<std::pair<std::string, int>> regex_color
{
    {"\\`", 1 }, //
    {"\\'", 1},
    {"\\\"", 2},
};

if " 'if' statement blocks " option in C/C++->formatting->Edit profile -> Brace Style -> Statement Styles is set to "Same line".
The code block is indented as follows with all std::pair initializing lines concatenated into one line.
Code: [Select]
std::vector<std::pair<std::string, int>> regex_color
{
    {"\\`", 1 },{"\\'", 1},{"\\\"", 2}, //
};

If the option is set to "Next line", the indent is working as expected.
Because this code block has no relation with 'if' , I guess it's a bug, please help to check.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: 24.0.1 - C/C++ wrong indent
« Reply #1 on: January 21, 2020, 02:31:47 PM »
I can reproduce that, that does look like a parsing bug.  I'll take a look at it.  Thanks for the report.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: 24.0.1 - C/C++ wrong indent
« Reply #2 on: March 13, 2020, 05:31:29 PM »
This is fixed for the upcoming 24.0.2 point release.  There was a parser bug that was erroneously not accepting the trailing comma of the regex_color initializer list.  Thanks for the report.