[diffs/edit] Update editor API#942
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4e60ddd76
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (this.#options.clipboard !== undefined) { | ||
| e.preventDefault(); | ||
| queueRender(this.#handleCustomPasteEvent); |
There was a problem hiding this comment.
Suppress repeated custom clipboard pastes
When a diff editor is configured with a custom clipboard provider, holding Cmd/Ctrl+V sends repeated keydown events with e.repeat === true. This branch returns before the repeat guard below, so every repeat queues #handleCustomPasteEvent, duplicating the paste and re-running the expensive diff update that the guard is meant to avoid.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
handleCustomPasteEvent is for fixing repeat if a custom clipboard provide. this is recommend for electron apps which have the native clipboard API.
There was a problem hiding this comment.
AFAIK a custom clipboard doesn't fix the fundamental reason for the lagging repeat paste
There was a problem hiding this comment.
reverted the repeat paste change in a185233
onFocusandonBlurcallback optionssetOptionsmethodFilecomponent