Re: C++11 Lambda indentation in vim 7.4

136 views
Skip to first unread message

Christian Brabandt

unread,
Mar 26, 2014, 5:51:43 PM3/26/14
to vim...@googlegroups.com, vim...@googlegroups.com
On Mi, 26 Mär 2014, Klaus Rudolph wrote:

> C++ Lambda Expressions are now not longer an error in syntax highlighting and indentation since vim 7.4. But inside a lambda expression the indentation did not work as I expect.
>
> Auto indent (gg=G) gives the following result:
>
> auto x1=GenFunktor(
> []()
> {
> a+=2;
> {
> int x;
> x++;
> }
> }
> );
>
> What I expect:
>
> auto x1=GenFunktor
> (
> []()
> {
> a+=2;
> {
> int x;
> x++;
> }
> }
> );
>
> "simply" the normal indentation rules should also work inside the lambda expression. Is there a configuration setting to enable that?

I believe this needs a patch to vim for the builtin c indenting.
Redirecting to vim_dev.

Alternatively, there might exist some custom indenting scripts using
indentexpr() of Vim. Look at the scripts section at vim.org or github

Best,
Christian
--
Packungsaufschriften US-amerikanischer Produkte:
Auf SAINSBURY'S Erdnüssen:
Warnung: Enthält Nüsse.

Ivan Smirnov

unread,
Jul 27, 2017, 3:41:01 AM7/27/17
to vim_dev, vim...@googlegroups.com
Wonder if anyone has a solution to this yet?

mattn

unread,
Jul 27, 2017, 10:50:43 AM7/27/17
to vim_dev, vim...@googlegroups.com

mattn

unread,
Jul 27, 2017, 11:05:58 AM7/27/17
to vim_dev, vim...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages