Author Topic: RC1: C++11 lambda syntax indent  (Read 1455 times)

mklein

  • Community Member
  • Posts: 84
  • Hero Points: 2
RC1: C++11 lambda syntax indent
« on: October 22, 2015, 07:40:53 pm »
Hi,

I filed a case on this (CAS-67408-9WXW) and was told it would be fixed in this version, but I'm still seeing issues with indentation of new lines inside of C++11 lambdas being not correct. The same repro in the case is still broken for me.

Let me know if you need any more info.

Thanks,
Matt

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 940
  • Hero Points: 67
Re: RC1: C++11 lambda syntax indent
« Reply #1 on: October 22, 2015, 08:47:43 pm »
Ok, with the example I see from that case, it looks like doing the space after the 'for' no longer mis-indents that statement, but if I hit return right after the '{' of the lambda, it indenting way too much again.  I'll take a look and see what's changed, thanks for the report.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 940
  • Hero Points: 67
Re: RC1: C++11 lambda syntax indent
« Reply #2 on: October 23, 2015, 03:16:34 pm »
Yeah, there were a few issues still hanging out there, including one where syntax expansions could still get pushed to the wrong column.  Fixed for the next build.

mklein

  • Community Member
  • Posts: 84
  • Hero Points: 2
Re: RC1: C++11 lambda syntax indent
« Reply #3 on: November 03, 2015, 12:44:05 am »
Hi this is still not working the way that I would expect it to w/ RC4. Here is a small example:

    cluster_data->cluster_->setInitializedCb([this]() -> void { <- enter here
                                                                  * <- cursor put here
    });

I would generally expect to have syntax indent X spaces (in my case 2) from the beginning of the block on the next line. This is what clang-format does when I auto format it and what would happen when opening a normal brace.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 940
  • Hero Points: 67
Re: RC1: C++11 lambda syntax indent
« Reply #4 on: November 03, 2015, 02:24:00 pm »
Odd, I can reproduce it.  Taking a look.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 940
  • Hero Points: 67
Re: RC1: C++11 lambda syntax indent
« Reply #5 on: November 03, 2015, 05:44:56 pm »
Yes, the indent calculation I made was too simplistic.  I've made some changes, and so far it is working as expected for old examples.

When you get a chance, load the attached c.e file (Macro -> Load Module), and give it a try.

mklein

  • Community Member
  • Posts: 84
  • Hero Points: 2
Re: RC1: C++11 lambda syntax indent
« Reply #6 on: November 03, 2015, 07:39:16 pm »
Thanks will try it out now on RC5 and let you know if I see other issues.