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

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 4.9.0
    • Qt Creator 4.9.0-rc1
    • C/C++/Obj-C++ Support
    • None
    • Gentoo Linux AMD64. Creator installed using the official Qt installer.
    • Linux/X11
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: