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

Pasting methods declarations can give wrong indentation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 1.3.0
    • Qt Creator 1.3.0 rc1
    • Editors
    • None
    • 58e8fa0ea0b915a60ebb454b12e06b28b178adcf

    Description

      Qt Creator 1.2.94
      Based on Qt 4.6.0 (32 bit)
      Built on Oct 30 2009 at 01:23:09

      Assume a header file with the following contents (among others):

       class Foo {
       
          /**
           * Docs...
           * Docs...
           **/
          void bar ();
      };
      

      Select the method with whole lines starting from column 0. By "mistake" include the empty line before "/**". Now go paste it into class Frob and you would get this:

      class Frob {
       
          /**
           * Docs...
           **/
          void something ();
       
          /**
           * Docs...
           **/
          void ohYeah ();
       
              /**
               * Docs...
               * Docs...
               **/
              void bar ();
      };
      

      Wrong indentation. So, C-a and then C-i to reindent the entire file gives:

      class Frob {
       
          /**
           * Docs...
           **/
          void something ();
       
          /**
           * Docs...
           **/
          void ohYeah ();
       
          /**
               * Docs...
               * Docs...
               **/
          void bar ();
      };
      

      You have to manually reindent the bulk of the comment.

      The bug only seems to happen if you include an initial empty line in the copied block of text. If you copy with the first line being the "/**" line then it works ok. Also trailing empty lines don't affect the paste in any way.

      Attachments

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

        Activity

          People

            mae mae
            chakie Jan Ekholm
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes