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

Indentation jumps to right when editing generates invalid code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 13.0.0
    • None
    • All

    Description

      Consider the following code (cursor is marked with `|`):

      typedef struct S {
          int i;
          long l;
          float f;
          double d;
      } S;
      
      int main()
      {
          S s = {.i = 1|, .l = 2, .f = 3, .d = 4};
      
          return s.i;
      }
      

      I want to change the line to

      S s = {.i = 1}; //, .l = 2, .f = 3, .d = 4};
      

      so I press `}` and immediately the whole code is indented two times (see attached video).

      This also happens with `-tcs`, but I think depending on tab settings and previous/next lines the indentation can be much higher.

      The indentation is corrected once `;` is pressed but the effect is really annoying and makes you think you did something wrong.

      Attachments

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

        Activity

          People

            artem.sokolovskii Artem Sokolovskii
            aha_1980 André Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes