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

Incorrect code selection and drag'n'drop in editor with vertical code editing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 4.8.2
    • Editors
    • None
    • Kubuntu 18.10 x86_64
    • Linux/X11

    Description

      Unintended drag'n'drop can be really annoying when you're doing code copy/paste with vertical code selection. Here's the typical scenario:

      1. Press Alt+Left Mouse Button and select a rectangular piece of code. Copy it with Ctrl+Ins.
      2. Move the mouse cursor to a new location.
      3. Press Alt+Left Mouse Button and move the mouse vertically to make the cursor multi-line.
      4. Press Shift+Ins to paste the previously copied piece of code.

      In practice, at step 3 QtCreator changes the recrangular selection area to a line-wise selection starting at the top-left corner of the area selected in step 1 and ending at the point you clicked in step 3. Then, as you're moving the mouse cursor, QtCreator tries to drag the text selected this way and drops it in the location where you released the mouse button.

      I think, the conversion of the rectangular selection to a line-wise selection as you click Alt+LMB the second time is a bug. I would expect the selection to be reset when Alt+LMB is clicked, as it is with the normal (line-wise) selection and LMB clicks in code area. As a consequence, drag'n'drop gets activated here erroneously because of that text selection.

      Attachments

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

        Activity

          People

            davschul David Schulz
            lastique Andrey Semashev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes