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

"Add curly braces" only works for else-branch

XMLWordPrintable

    • fba00d6e5 (16.0)

      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.

        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.

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes