Desktop: Fixes #13745: Prevent cut events from being merged with other actions in the undo history#13791
Merged
laurent22 merged 7 commits intolaurent22:devfrom Nov 29, 2025
Conversation
… other events in the undo history
…andler for copy/cut/paste
Contributor
|
FYI the issue fixed in the title is correct, but the hyperlink in the description is wrong. It should be #13745 |
| const event = new ClipboardEvent(action.type, { | ||
| clipboardData, | ||
| }); | ||
| view.contentDOM.dispatchEvent(event); |
Collaborator
Author
There was a problem hiding this comment.
Converting to a draft. Based on the CI failure, this approach doesn't seem to work on Windows.
It may make sense to use this approach (in the original commit) instead.
…pboard handler for copy/cut/paste" This reverts commit 1076ec8.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request updates the
textCutcommand to prevent "cut" actions from being merged with other actions in the undo history.Fixes #13745.
Notes
dispatchEvent(new ClipboardEvent(...)). There isn't a documented way to run CodeMirror's cut/copy/paste handlers, so this approach may be fragile. Furthermore, it seems to fail on Windows (see comment).Testing
This pull request includes a Playwright test for full-line cut/copy/paste. It has additionally been manually verified that: