Open
Description
Description
When dragging a selected piece of text to a new location in the editor, the operation correctly moves the text to the drop target. However, pressing Undo
(⌘Z
) only removes the inserted text at the new location. A second Undo
is required to restore the text at its original location.
This results in an unintuitive and inconsistent undo experience. The drag operation should be treated as a single atomic change.
To Reproduce
- Select a range of text in the editor.
- Drag and drop the selected text to a different location.
- Press
Undo
(⌘Z
). - Notice the text disappears.
- Press
Undo
(⌘Z
) a second time. - Notice the text is restored in it's original location.
Expected Behavior
- First undo: fully reverts the drag-and-drop operation (i.e., puts the text back where it was and removes it from the drop location).
Current Behavior
- First undo: removes the text at the drop location.
- Second undo: restores the text at the original location.
Version Information
CodeEditTextView: [e.g. 0.x.y]
macOS: [e.g. 13.2.1]
Xcode: [e.g. 14.2]
Additional Context
The drag operation should be wrapped in a single undo grouping so that both the deletion and insertion are undone together.
Screenshots
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
🆕 New