Author Topic: B4: C++ lamda auto indentation is funky (quirk)  (Read 3777 times)

skywise

  • Senior Community Member
  • Posts: 331
  • Hero Points: 10
B4: C++ lamda auto indentation is funky (quirk)
« on: September 12, 2014, 09:13:44 PM »
Probably not much you can do at this point but I thought I'd bring it up:
Personally, I think lambdas should break underneath the lambda declaration itself
std::remove_if(bigStr.begin(), bigStr.end(), [](const char* x)
                                                                {
                                                                     // my stuff here...
                                                                }

But SE will always put the brace at the far left, forcing me to manually indent to my style EG:

std::remove_if(bigStr.begin(), bigStr.end(), [](const char* x)
{
     // my stuff here...
}
(Although frankly I don't think I've settled on any particular style yet...)  How's this handled in Java?

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: B4: C++ lamda auto indentation is funky (quirk)
« Reply #1 on: September 12, 2014, 11:04:37 PM »
I think the closest thing in Java is the anonymous class, which usually would be indented past the function parens.

I'll take a look at it.  Are you doing this with "Beautify while typing" is on or off?

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: B4: C++ lamda auto indentation is funky (quirk)
« Reply #2 on: September 15, 2014, 07:50:17 PM »
I put in a fix for the next beta drop.  Thanks for the report.

skywise

  • Senior Community Member
  • Posts: 331
  • Hero Points: 10
Re: B4: C++ lamda auto indentation is funky (quirk)
« Reply #3 on: September 15, 2014, 09:20:24 PM »
Thanks! Just FYI -
Beautify syntax expansions and Beautify Alias expansions were checked, all other beautify options (including beautify while typing) were NOT checked.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: B4: C++ lamda auto indentation is funky (quirk)
« Reply #4 on: September 15, 2014, 09:38:43 PM »
That's fine.  It ends up the fix should work regardless of those settings, so I probably didn't need to ask that in the first place.  :)

skywise

  • Senior Community Member
  • Posts: 331
  • Hero Points: 10
Re: B4: C++ lamda auto indentation is funky (quirk)
« Reply #5 on: September 17, 2014, 02:50:27 PM »
Did this make B5?  When running on B5 -  I've got the following line of code with the cursor at the end:
Code: [Select]
std::remove_if(myList.begin(), myList.end(),[targetList](myStuff::app::myApp::myData const& x)->bool
If I hit enter the cursor goes under the first parenthesis after remove_if which seems like new behavior.  But as soon as I hit "{" the auto-fill moves the cursor to, and puts the begin and end brace on, the first column.  If I hand set the brace to the correct location and hit enter to being entering text the cursor moves to the first column.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: B4: C++ lamda auto indentation is funky (quirk)
« Reply #6 on: September 17, 2014, 04:12:46 PM »
It did get in earlier.  But I'm not sure why it's moving the brace in that case, I'll have to take another look at it.

skywise

  • Senior Community Member
  • Posts: 331
  • Hero Points: 10
Re: B4: C++ lamda auto indentation is funky (quirk)
« Reply #7 on: September 17, 2014, 04:28:36 PM »
Thanks - I'm running brief keymode too.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: B4: C++ lamda auto indentation is funky (quirk)
« Reply #8 on: September 19, 2014, 02:19:48 PM »
Fixed for the next beta drop.  It was stumbling on the return type in the declaration.