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

C++ code editor collapse / expand block issue

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 14.0.1
    • Editors
    • OS: Linux
      CPU architecture: x86_64
      Distribution: Fedora 39
    • Linux/Wayland

    Description

      Hello,

      I'm having a weird issue with the C++ code editor when I collapse / expand code.
      It is hard to explain but easy to see.

      With the attached code, just do the following:

      1. Open it in QtCreator
      2. Add a `return 0;` in `foo` after `std::cout`
      3. Collapse the function `foo`
      4. Add a new line in the bar function

      After this you should be in the same state as I am in this screenshot:

      As you can see the foo function as partially reappeared, the cursor is after the bar function even if I have effectively added a new line inside the bar function and it has collapsed even though I didn't ask it to do so. I have also included another screenshot that shows the complete expanded code after edition for reference.

      Also you should note that this happen only if you do an edit in a block that is above the next edit that you will do after you have collapsed said block. In other word, in my example if I edit `bar`, then collapse it and finally edit `foo`, nothing unexpected will happen.

      Attachments

        1. after.png
          after.png
          13 kB
        2. before.png
          before.png
          11 kB
        3. file.cpp
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            davschul David Schulz
            forbinn Vincent Leroy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes