Add better fall backs to standard pasting logic #181585
Merged
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.
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 correctlyIf 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