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

Autoindent incorrect behaviour with macros

    XMLWordPrintable

Details

    Description

      The auto indent function of qt creator does not work correctly with macros.

      How to reproduce:

      Create a header file with a macro like this:

      #define TEST_MACRO(TEST_PARAM)

      the macro basically does nothing, but it doenst matter. you could also have a macro that does something or just creates a semicolon like this:

      #define TEST_MACRO(TEST_PARAM) \
      ;

      Now include that header file in your cpp file and use it:

      Lets assume the code is

      TEST_MACRO(test)
      // some comment
      std::cout << "hello" << std::endl;

      //comment 2

      Using Ctrl+I it formats it to

      TEST_MACRO(test)
      // some comment
      std::cout << "hello" << std::endl;

      //comment 2

      It is 8 white spaces too far to the right. I dont know why, but comment 2 is formatted correctly...

      Edit: unfortunately you cant see the wrong white spaces in view mode... i will add a screenshot.

      Attachments

        Activity

          People

            kandeler Christian Kandeler
            tompollok Thomas Pollok
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: