Author Topic: C++ lambda formatting option  (Read 390 times)

astromme

  • Senior Community Member
  • Posts: 154
  • Hero Points: 1
C++ lambda formatting option
« on: October 03, 2023, 06:56:25 PM »
When I want to enter a lambda, I type this all out by hand:
Code: [Select]
    std::for_each(container.begin(), container.end(), [](){});

Then, I press enter between the braces and get this (the carat is where the cursor is):
Code: [Select]
    std::for_each(container.begin(), container.end(), [](){
        ^
                                                          });

What I want is this:
Code: [Select]
    std::for_each(container.begin(), container.end(), [](){
        ^
    });

Is there any way to autoformat the closing brace on the same column as the std::for_each?
« Last Edit: October 06, 2023, 10:20:57 PM by astromme »

Dennis

  • Senior Community Member
  • Posts: 3983
  • Hero Points: 517
Re: C++ lambda formatting option
« Reply #1 on: October 16, 2023, 08:00:13 PM »
I've reproduced this problem and I am looking into it.

Dennis

  • Senior Community Member
  • Posts: 3983
  • Hero Points: 517
Re: C++ lambda formatting option
« Reply #2 on: October 16, 2023, 09:53:24 PM »
I have a fix, but it was too late for the upcoming beta 4.

Dennis

  • Senior Community Member
  • Posts: 3983
  • Hero Points: 517
Re: C++ lambda formatting option
« Reply #3 on: October 17, 2023, 05:33:57 PM »
Attached is a hot fix for this problem for beta4.