🐞 <bug title>
bug
### 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
1. Select a range of text in the editor.
2. Drag and drop the selected text to a different location.
3. Press `Undo` (`⌘Z`).
4. Notice the text disappears.
5. Press `Undo` (`⌘Z`) a second time.
6. 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_
0 条评论