Skip to content

Commit

Permalink
Restore default paste fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Sep 5, 2023
1 parent f1302be commit 4d0398f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ export class CopyPasteController extends Disposable implements IEditorContributi
return;
}

// If the only edit returned is a text edit, use the default paste handler
if (providerEdits.length === 1 && providerEdits[0].providerId === 'text') {
await this.applyDefaultPasteHandler(dataTransfer, metadata, tokenSource.token);
return;
}

if (providerEdits.length) {
const canShowWidget = editor.getOption(EditorOption.pasteAs).showPasteSelector === 'afterPaste';
return this._postPasteWidgetManager.applyEditAndShowIfNeeded(selections, { activeEditIndex: 0, allEdits: providerEdits }, canShowWidget, tokenSource.token);
Expand Down

0 comments on commit 4d0398f

Please sign in to comment.