Skip to content

Commit d009c2e

Browse files
committed
✨ Feature(custom): support disable upload on drag
1 parent e3ebdab commit d009c2e

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@
125125
"type": "boolean",
126126
"default": false,
127127
"markdownDescription": "%config.encodeUrl.description%"
128+
},
129+
"piclist.enableDragUpload": {
130+
"type": "boolean",
131+
"default": true,
132+
"markdownDescription": "%config.enableDragUpload.description%"
128133
}
129134
}
130135
}

package.nls.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
"config.copyType.custom": "Custom",
1717
"config.copyType.description": "Copy type, default is `Markdown: ![alt](url)`, support `Markdown`, `HTML`, `URL`, `UBB`, `Custom`",
1818
"config.customType.description": "Custom copy type, default is `Markdown: ![$fileName]($url)`, support `$fileName`, `$url`",
19-
"config.encodeUrl.description": "Whether to encode the URL, default is `false`"
19+
"config.encodeUrl.description": "Whether to encode the URL, default is `false`",
20+
"config.enableDragUpload.description": "Whether to enable drag upload, default is `true`"
2021
}

src/vscode/dropProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export class UploadonDropProvider implements vscode.DocumentDropEditProvider {
1010
dataTransfer: vscode.DataTransfer,
1111
token: vscode.CancellationToken
1212
): Promise<vscode.DocumentDropEdit | undefined> {
13+
const enable = vscode.workspace.getConfiguration('piclist').get('enableDragUpload') ?? true
14+
if (!enable) return undefined
1315
const dataTransferItem = dataTransfer.get(uriListMime)
1416
if (!dataTransferItem) return undefined
1517
const urlList = await dataTransferItem.asString()

0 commit comments

Comments
 (0)