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

ClangFormat plugin deletes empty lines when typing "{" or "("

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • Qt Creator 4.9.0-beta2
    • Qt Creator 4.9.0-beta1
    • C/C++/Obj-C++ Support
    • None
    • Gentoo Linux x86-64.
    • Linux/X11

      In Creator 4.9 beta1 and beta2, the ClangFormat plugin deletes all empty lines that precede the current one when typing "{" or "(". For example, consider I have this code:

       

      if (failed) {
          throw failure;
      }
       
      if

       

      Now if I  type the "(", Creator will immediately transform the above code to:

      if (failed) {
          throw failure;
      }
      if (

      It will delete all empty lines between the "}" and "if". Needless to say, this should not be happening.

      In the settings, in the "C++/Code Style" tab, it doesn't matter whether or not "Format instead of indenting" is enabled or disabled. The editor deletes the empty lines regardless.

      Creator was installed using the online installer (64-bit.)

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

            yvvan Ivan Donchevskii
            realnc Nikos Chantziaras
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes