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

Incorrect indent for Clang-style lambda blocks

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4: Low
    • Resolution: Unresolved
    • Affects Version/s: Qt Creator 3.0.0-rc1
    • Fix Version/s: None
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None

      Description

      Steps to reproduce:

      • Reset Qt Creator settings (rm -Rf ~/.config/QtProject/qtcreator)
      • File > New File or Project... > C++ Class
      • Inside the automatically-created constructor, insert a new line and type dispatch_async(dispatch_get_main_queue(), ^{ then press return, then type something (for example return;) on the next line.

      The return; line is indented with 23 leading spaces. I would have expected it to be indented with 8 leading spaces — a first indent since it's inside the constructor, and a second indent because it's inside a Clang-style lambda block.

      See also the attached screenshots of actual and expected behavior.

        Attachments

        1. indent-actual_.png
          indent-actual_.png
          33 kB
        2. indent-expected.png
          indent-expected.png
          37 kB
        3. qtcreator-11016-block-indent.patch
          0.6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              kosjar Nikolai Kosjar
              Reporter:
              smokris Steve Mokris
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes