Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-15156

Code indentation in lambda functions incorrect

    XMLWordPrintable

Details

    Description

      When typing multi-line C++ code inside a lambda function that is indented relative to the outer scope, the editor ignores the lambda indentation and indents the lambda body relative to the outer scope.

      For instance, try typing this piece of code:

      std::thread // 1
      (
          []() //2
          {
              try //3
              {
              }
              catch()
              {
              }
          }
      ).detach();
      

      Note that the lambda body is indented deeper than the std::thread declaration scope (1). Yet as I type the lambda body, the editor puts closing braces and the cursor after a newline to the lambda level (2) instead of one level deeper (3).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            artem.sokolovskii Artem Sokolovskii
            lastique Andrey Semashev
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes