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

ClangFormat plugin does bogus indent when typing parenthesis or angle brackets

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: Qt Creator 4.9.0-rc1
    • Fix Version/s: Qt Creator 4.9.0
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None
    • Environment:
      Gentoo Linux AMD64. Creator installed using the official Qt installer.
    • Platform/s:
      Linux/X11
    • Commits:
      01a528c77a3aee7cdd264f9f71d9b2d30a9c775a (qt-creator/qt-creator/4.9)

      Description

      When using the ClangFormat plugin, the editor will sometimes wrongly indent the current line when typing "(", "<" or ">". For example, when you have this: 

      int foo()
      {
          // Blah.
      
          if 
      } 
      

      and the text cursor is at the "if", when you type the "(", the code gets indented: 

      int foo()
      {
          // Blah.
      
              if (
      }
      

       The same happens with this code too: 

      int foo()
      {
      #ifdef FOO
      #endif
      
              if (
      }
      

       Angle brackets have the same issue. For example:

       

      int foo()
      {
          bar();
      
          if (baz
      
      }
      

      As soon as you type ">", it gets indented:

       

      int foo()
      {
          bar();
       
              if (baz >
      }
      

       

        Attachments

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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes