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

Limit drop disablement to just http(s) uris #209240

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,14 @@ class ResourcePasteOrDropProvider implements vscode.DocumentPasteEditProvider, v
return;
}

// Disable ourselves if there's also a text entry with the same content as our list,
// In some browsers, copying from the address bar sets both text/uri-list and text/plain.
// Disable ourselves if there's also a text entry with the same http(s) uri as our list,
// unless we are explicitly requested.
if (uriList.entries.length === 1 && !context?.only?.contains(ResourcePasteOrDropProvider.kind)) {
if (
uriList.entries.length === 1
&& (uriList.entries[0].uri.scheme === Schemes.http || uriList.entries[0].uri.scheme === Schemes.https)
&& !context?.only?.contains(ResourcePasteOrDropProvider.kind)
) {
const text = await dataTransfer.get(Mime.textPlain)?.asString();
if (token.isCancellationRequested) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export function createInsertUriListEdit(
return;
}


const edits: vscode.SnippetTextEdit[] = [];

let insertedLinkCount = 0;
Expand Down
Loading