https://bugs.kde.org/show_bug.cgi?id=475175

            Bug ID: 475175
           Summary: Interactions between LSP Go to Definition and
                    conventional Ctrl+Drag behavior
    Classification: Applications
           Product: kate
           Version: 23.08.1
          Platform: openSUSE
                OS: Linux
            Status: REPORTED
          Severity: minor
          Priority: NOR
         Component: general
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: groszdaniel...@gmail.com
  Target Milestone: ---

SUMMARY
The LSP feature of going to the definition on Control+Click interacts poorly
with the pre-existing effects of Control+Drag:
- If you attempt to Control+Drag some selected text to copy it, and happen to
have the mouse over an identifier when you start it, the editor goes to the
definition, and then offers to drop the dragged text there (often in a
different file).
- If you Control+Click an identifier without it being selected, and then
slightly move the mouse after it goes to the definition, it selects the text
between the target (at the center of the editor) and the mouse position, which
is unintended and looks weird.

STEPS TO REPRODUCE
With selection:
1. Select some text, including an identifier.
2. Press Ctrl and the mouse button over the identifier.
3. Move the mouse and then release the button.

Without selection:
1. Press Ctrl and the mouse button over the identifier.
2. Move the mouse a little.

OBSERVED RESULT
With selection: goes to the definition (or declaration), and then copies the
selected text there.

Without selection: goes to the definition, and then selects text between the
location of the definition (typically vertically at the center of the editor)
and the mouse cursor.

EXPECTED RESULT
With selection: drags and copies the selection, without going to the
definition.

Without selection: Goes to the definition, and doesn't select text.

POSSIBLE SOLUTIONS
- Activate Go to Definition on mouse release, rather than mouse press, and then
only if it hasn't been moved. (Perhaps a minor downside is that moving the
mouse even slightly, within the identifier, disables Go to Definition.)
- Only activate Go to Definition on mouse release if the click is inside a
selection, and then only if no drag is started. If the click isn't inside a
selection, activate it on mouse press, but don't start a selection afterwards
if the mouse is dragged.
- Always activate Go to Definition on mouse release, only if it's not dragging
a selection, and if the mouse is still within the same identifier as when it
was pressed. (If there was no selection, this is consistent with clicking a
button.)

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20230929
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.4.11-1-default (64-bit)
Graphics Platform: X11

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to