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

Auto Indent does not handle exception handling blocks correctly

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: Qt Creator 3.1.1, Qt Creator 3.2.0-beta1, Qt Creator 3.3.0-beta1
    • Fix Version/s: None
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None
    • Environment:
      Windows 7

      Description

      Braces and lines of the try/catch/... statements are incorrectly indented when settings are as follows:

      • braces are supposed to be indented
      • lines within blocks are supposed not to be indented

      required behaviour which works:

      if ( something )
        {
        do_something();
        }
      

      required behaviour which does not work:

      try
        {
        do_something();
        }
      catch(...)
        {
        do_something_else();
        }
      

      for the example above braces are either left intact or opening brace is left as well as lines of code inside are left, while the closing brace is indented.

      In my opinion the setting in 'Braces' page in 'Edit Code Style' dialog do not consider blocks in try/catch/... blocks as a block for indetation.

        Attachments

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

          Activity

            People

            • Assignee:
              kosjar Nikolai Kosjar
              Reporter:
              prismacolor prisma color
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes