You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -181 +183 @@ class ExecCommandPasteAction extends ExecCommandAction {
272
+
@@ -181 +185 @@ class ExecCommandPasteAction extends ExecCommandAction {
263
273
- precondition: EditorContextKeys.writable,
264
274
+ precondition: (require('vs/platform/contextkey/common/contextkey') as typeof import('vs/platform/contextkey/common/contextkey')).ContextKeyExpr.and(EditorContextKeys.writable, workbench.clipboardContextKey),
265
-
@@ -191 +193,2 @@ class ExecCommandPasteAction extends ExecCommandAction {
275
+
@@ -191 +195,2 @@ class ExecCommandPasteAction extends ExecCommandAction {
266
276
- order: 3
267
277
+ order: 3,
268
278
+ when: workbench.clipboardContextKey,
269
-
@@ -194,0 +198,14 @@ class ExecCommandPasteAction extends ExecCommandAction {
279
+
@@ -194,0 +200,26 @@ class ExecCommandPasteAction extends ExecCommandAction {
270
280
+
271
281
+ public async run(accessor, editor: ICodeEditor): Promise<void> {
272
282
+ if (editor instanceof (require('vs/editor/browser/widget/codeEditorWidget') as typeof import('vs/editor/browser/widget/codeEditorWidget')).CodeEditorWidget) {
273
283
+ try {
274
-
+ editor.trigger('', (require('vs/editor/common/editorCommon') as typeof import ('vs/editor/common/editorCommon')).Handler.Paste, {
275
-
+ text: await (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.clipboardText,
284
+
+ editor.focus();
285
+
+ const textInput = document.activeElement! as HTMLTextAreaElement;
286
+
+ const dataTransfer = new DataTransfer();
287
+
+ const value = await clipboard.readText();
288
+
+ dataTransfer.setData("text/plain", value);
289
+
+ const pasteEvent = new ClipboardEvent("paste", {
290
+
+ clipboardData: dataTransfer,
276
291
+ });
292
+
+ textInput.dispatchEvent(pasteEvent);
277
293
+ } catch (ex) {
278
-
+ super.run(accessor, editor);
294
+
+ try {
295
+
+ editor.trigger('', (require('vs/editor/common/editorCommon') as typeof import ('vs/editor/common/editorCommon')).Handler.Paste, {
296
+
+ text: await (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.clipboardText,
0 commit comments