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

Correct indentation doesn't work with brace initialization and the conditional assignment operator

    XMLWordPrintable

Details

    Description

      "Correct indentation" doesn't work correctly if you combine brace initialization and the conditional assignment operator.

      Minimal example:
      Copy and paste the text below into the QT Creator 3.0.0 editor and try to correct the indentation (e.g. via CTRL-I).

      Input:

      int main()
      {
      int i = 1;
      int j{i?5:10};
      return 0;
      }
      
      

      Expected output:

      int main()
      {
          int i = 1;
          int j{i?5:10};
          return 0;
      }
      

      Output:

      int main()
      {
          int i = 1;
          int j{i?5:10};
                return 0;
               }
      

      Attachments

        1. Indentation.png
          Indentation.png
          10 kB
        2. main.cpp
          0.1 kB

        Issue Links

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

          Activity

            People

              kandeler Christian Kandeler
              uli1729 Uli
              Votes:
              5 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes