Sublime Forum

[macOS / ST4] Drag-and-drop fails after scrolling with Alt key (copy)

#1

Hi,

In Sublime Text 4 on macOS, I’ve noticed an issue when using Alt + drag-and-drop to copy selected text.
The issue also appears when moving text without copying it (so without the Alt key).

It works (it duplicates the text) when I release the mouse within the visible area. But if I scroll with the trackpad between the DRAG and the DROP, it fails.

Steps to reproduce:

  1. Select some text.
  2. Hold Alt (Option) and start dragging the selection.
  3. Scroll the editor while dragging.
  4. Try to drop the text at the new location.
  5. Try the same in SAFE MODE => Same result.

Actual behavior: Scrolling works, but the drop fails and the text is not copied.

Expected behavior: The selected text should be copied to the drop location, even after scrolling.

Config: :

  • macOS Sequoia 15.7.9 (24G830)
  • Sublime Text 4200

This worked correctly in Sublime Text 2, so it appears to be a regression.

Is this a known issue, or is there a workaround?

Thanks a lot?
Alex

0 Likes

#2

As TextEdit is able to handle such cases (drag to move or copy text even after scrolling), this does not seems to be a global OS problem, but something that could be corrected in the ST engine itself.

0 Likes

#3

Do you have custom mouse/key bindings, or some other software to intercept keyboard and mouse controls, like keyboard maestro?

Normally alt/opt + drag on MacOS performs a column selection:


alt/opt + drag in TextEdit does something similar:

0 Likes

#4

Hi Greg @gbird,

Sorry it seems that my question was not clear enough.
Column selection properly works.

The problem I am reporting is not about selection, but with how to move or copy this selection.

The problem is that once a text IS selected, I click on it and move the cursor around to move this selected text.
The ALT key may also be pressed for copying and not just moving the selected text.

Once a scrolling event occurs (on trackpad or with mouse wheel), even a slight 1px scroll, the reported problem happens: the source text is not moved nor copied.

I’ve tried with Sublime Text started in SAFE MODE, and with the Keyboard Maestro engine completely disabled/stopped/off.

0 Likes

#5

I see what you mean. I’ll be honest, I would never consider moving or copying a selection in that manner. Feels so unnatural to me - like patting your head and rubbing your tummy … I guess it is what you are used to, plus muscle memory.

But you are right, it only works if your drop zone is within the current viewport - as soon as you have to scroll it seems to lose the selection and nothing is dropped.

Over to brighter minds than I, I’m afraid.

0 Likes