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

Use of Beautifier and its format on save option mess up scrolling

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 4.11.0
    • Editors
    • None
    • Linux/Wayland, Linux/X11

    Description

      While editing a file whose vertical size exceeds the height of the screen, the behavior of the beautifier becomes unstable, the scroll bar is messed up.

      Here is how to reproduce this behavior:

      • Collapse the view of a long function/class, then add 2 empty lines after it, keeping the cursor on the second line.
      • Hit Ctrl+S with beautifier's format on save enabled. The scroll bar now shows the current line (black) is above it.
      • Scroll up one step. the editor now shows the beginning of the document.
      • Scroll further up, the editor now shows a blank page. This happens to be below the bottom of the document.
      • Scroll up a bit more to see the last line, then it starts to look normal, except the scroll bar. It has a long empty space under it that does not correspond to the document.
      • Now delete any line from the document, and the empty space disappears.

      I've attached here a file that shows that exact behavior.

      This happens on both Ubuntu 20.04 and OpenSUSE Tumbleweed 

      Attachments

        1. main.cpp
          1 kB
          Dat Ng
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            davschul David Schulz
            uthidata Dat Ng
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes