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

"Add curly braces" only works for else-branch

    XMLWordPrintable

Details

    • fba00d6e5 (16.0)

    Description

      1. Have a simple condition:
            int a = 0;
            int b = 0;
            if (a)
                b = 1;
            else
                b = 0;
        
      2. Place the cursor in the line starting with "if" and trigger quick fixes (Alt+Enter).
        Creator shows "Add curly braces".
      3. Press Enter to apply that fix.
        Actual: Curly braces are added around the else-branch only. If there is no else-branch, Creator doesn't even offer this quick fix.
        Expected: Curly braces are also added to the first conditional branch.

      Attachments

        1. CMakeLists.txt
          0.3 kB
          Robert Löhning
        2. main.cpp
          0.2 kB
          Robert Löhning
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes