Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better fall backs to standard pasting logic #181585

Merged
merged 1 commit into from May 4, 2023

Conversation

mjbvz
Copy link
Contributor

@mjbvz mjbvz commented May 4, 2023

Fixes #181489

This tries to avoid having copy paste provider mess up normal text copy and paste by doing the following:

  • When copy paste providers are used but none end up handling the paste, compute the PastePayload we pass back to the editor more correctly

  • If only a single provider is used and it's the default text provider, fall back to the editor's paste handler instead of using the provider. This is a workaround until we figure out how/if to make paste providers aware of empty selection copies and multi cursor copies

  • Be more aggressive about avoiding invoking providers. Before deciding to override paste, we now check a list of possible mime types on the clipboard. We can then use this list to filter out providers which we know will not handle any of these types

Fixes microsoft#181489

This tries to avoid having copy paste provider mess up normal text copy and paste by doing the following:

- When copy paste providers are used but non end up handling the paste,  compute the `PastePayload` more correctly

- If only a single provider is used and it's the default text provider, fall back to the editor's paste handler instead or using it

- Be more aggressive about avoiding invoking providers. Before deciding to override paste, we now check a list of possible mime types on the clipboard. We can then use this list to filter out providers which we know will not handle any of these types
@mjbvz mjbvz self-assigned this May 4, 2023
@mjbvz mjbvz added this to the May 2023 milestone May 4, 2023
@mjbvz mjbvz enabled auto-merge (squash) May 4, 2023 19:57
@mjbvz mjbvz merged commit 1a29d4c into microsoft:main May 4, 2023
7 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy/Paste line is not putting it to new line
2 participants