Skip to content

Commit bb5c4d5

Browse files
Fix: use default paste when only text is pasted (microsoft#186649)
* bug fixes * added label to copyPaste.ts * added localized label to copyPasteLinks file * quick fix for pasting highlight bug * concise if-statement
1 parent 661fbc9 commit bb5c4d5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,12 @@ export class CopyPasteController extends Disposable implements IEditorContributi
282282
return;
283283
}
284284

285+
// If the only edit returned is a text edit, use the default paste handler
286+
if (providerEdits.length === 1 && providerEdits[0].id === 'text') {
287+
await this.applyDefaultPasteHandler(dataTransfer, metadata, tokenSource.token);
288+
return;
289+
}
290+
285291
if (providerEdits.length) {
286292
const canShowWidget = editor.getOption(EditorOption.pasteAs).showPasteSelector === 'afterPaste';
287293
return this._postPasteWidgetManager.applyEditAndShowIfNeeded(selections, { activeEditIndex: 0, allEdits: providerEdits }, canShowWidget, tokenSource.token);

0 commit comments

Comments
 (0)