Wednesday, April 23, 2014

Re: C++11 Lambda indentation in vim 7.4

Did you try clang-format? C++ is so complex a language that only a real C++ parser can deal things correctly. Clang-format is also highly configurable, with easy integration with Vim.

On 26 March 2014 22:12, Klaus Rudolph <lts-rudolph@gmx.de> 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?

Regards
   Klaus


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Wu Yongwei
URL: http://wyw.dcweb.cn/

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: