SlickEdit Community

Archived Read Only Forums => SlickEdit 2015 v20 Beta Discussion => Topic started by: mklein on October 22, 2015, 07:40:53 pm

Title: RC1: C++11 lambda syntax indent
Post by: mklein 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
Title: Re: RC1: C++11 lambda syntax indent
Post by: patrick 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.
Title: Re: RC1: C++11 lambda syntax indent
Post by: patrick 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.
Title: Re: RC1: C++11 lambda syntax indent
Post by: mklein 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.
Title: Re: RC1: C++11 lambda syntax indent
Post by: patrick on November 03, 2015, 02:24:00 pm
Odd, I can reproduce it.  Taking a look.
Title: Re: RC1: C++11 lambda syntax indent
Post by: patrick 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.
Title: Re: RC1: C++11 lambda syntax indent
Post by: mklein 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.