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

[REG 4.3->4.4] Curly brace completion adds closing brace where unneeded

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • Qt Creator 4.10.0-beta1
    • Qt Creator 4.4.0
    • Editors
    • None
    • Windows 7 x64, -Clang Code Model-
    • 0bac3ad279450d6a19093e0d58036774cc66c7ca (qt-creator/qt-creator/master)

      Not sure it is related to the Clang Code Model, but I remember that in former versions the closing curly brace was inserted on Enter after an opening curly brace.

      Now typing an opening curly brace automatically inserts the closing one.

      This is especially annoying when you refactor code like the following:

      bool result = f();
      if (!result) {
        // error handling
      }

      to

      if (!f()) {
        // error handling
      }

      because when editing the following occurs:

      if (!f()) {} // editing this line inserts an unneeded closing brace
      if (!result) { // This line will be removed
        // error handling
      }

        For Gerrit Dashboard: QTCREATORBUG-18872
        # Subject Branch Project Status CR V

            kosjar Nikolai Kosjar
            aha_1980 André Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes