mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-26 18:27:38 +01:00
@@ -229,7 +229,7 @@ if (PasteAction) {
|
||||
if (focusedEditor && focusedEditor.hasTextFocus()) {
|
||||
const result = focusedEditor.getContainerDomNode().ownerDocument.execCommand('paste');
|
||||
if (result) {
|
||||
return CopyPasteController.get(focusedEditor).finishedPaste();
|
||||
return CopyPasteController.get(focusedEditor)?.finishedPaste() ?? Promise.resolve();
|
||||
} else if (platform.isWeb) {
|
||||
// Use the clipboard service if document.execCommand('paste') was not successful
|
||||
return (async () => {
|
||||
|
||||
@@ -51,8 +51,8 @@ export class CopyPasteController extends Disposable implements IEditorContributi
|
||||
|
||||
public static readonly ID = 'editor.contrib.copyPasteActionController';
|
||||
|
||||
public static get(editor: ICodeEditor): CopyPasteController {
|
||||
return editor.getContribution<CopyPasteController>(CopyPasteController.ID)!;
|
||||
public static get(editor: ICodeEditor): CopyPasteController | null {
|
||||
return editor.getContribution<CopyPasteController>(CopyPasteController.ID);
|
||||
}
|
||||
|
||||
private readonly _editor: ICodeEditor;
|
||||
|
||||
Reference in New Issue
Block a user