@@ -8,6 +8,67 @@ index 457818a975..ad45ffe58a 100644
8
8
}
9
9
+
10
10
+ startup({ machineId: "1" });
11
+ diff --git a/src/vs/editor/contrib/clipboard/clipboard.ts b/src/vs/editor/contrib/clipboard/clipboard.ts
12
+ index 5e43f1b39e..7775e3b6da 100644
13
+ --- a/src/vs/editor/contrib/clipboard/clipboard.ts
14
+ +++ b/src/vs/editor/contrib/clipboard/clipboard.ts
15
+ @@ -16,6 +16,10 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
16
+ import { MenuId } from 'vs/platform/actions/common/actions';
17
+ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
18
+ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
19
+ + import { CodeEditorWidget } from "vs/editor/browser/widget/codeEditorWidget";
20
+ + import { Handler } from "vs/editor/common/editorCommon";
21
+ + import { ContextKeyExpr } from "vs/platform/contextkey/common/contextkey";
22
+ + import { client } from "../../../../../../../packages/vscode";
23
+
24
+ const CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste';
25
+
26
+ @@ -26,7 +30,8 @@ const supportsCopyWithSyntaxHighlighting = (supportsCopy && !browser.isEdgeOrIE)
27
+ // Chrome incorrectly returns true for document.queryCommandSupported('paste')
28
+ // when the paste feature is available but the calling script has insufficient
29
+ // privileges to actually perform the action
30
+ - const supportsPaste = (platform.isNative || (!browser.isChrome && document.queryCommandSupported('paste')));
31
+ + // const supportsPaste = (platform.isNative || (!browser.isChrome && document.queryCommandSupported('paste')));
32
+ + const supportsPaste = true;
33
+
34
+ type ExecCommand = 'cut' | 'copy' | 'paste';
35
+
36
+ @@ -178,7 +183,7 @@ class ExecCommandPasteAction extends ExecCommandAction {
37
+ id: 'editor.action.clipboardPasteAction',
38
+ label: nls.localize('actions.clipboard.pasteLabel', "Paste"),
39
+ alias: 'Paste',
40
+ - precondition: EditorContextKeys.writable,
41
+ + precondition: ContextKeyExpr.and(EditorContextKeys.writable, client.clipboardContextKey),
42
+ kbOpts: kbOpts,
43
+ menuOpts: {
44
+ group: CLIPBOARD_CONTEXT_MENU_GROUP,
45
+ @@ -188,10 +193,25 @@ class ExecCommandPasteAction extends ExecCommandAction {
46
+ menuId: MenuId.MenubarEditMenu,
47
+ group: '2_ccp',
48
+ title: nls.localize({ key: 'miPaste', comment: ['&& denotes a mnemonic'] }, "&&Paste"),
49
+ - order: 3
50
+ + order: 3,
51
+ + when: client.clipboardContextKey,
52
+ }
53
+ });
54
+ }
55
+ +
56
+ + public async run(accessor, editor: ICodeEditor): Promise<void> {
57
+ + if (editor instanceof CodeEditorWidget) {
58
+ + try {
59
+ + editor.trigger('', Handler.Paste, {
60
+ + text: await client.clipboardText,
61
+ + });
62
+ + } catch (ex) {
63
+ + super.run(accessor, editor);
64
+ + }
65
+ + } else {
66
+ + super.run(accessor, editor);
67
+ + }
68
+ + }
69
+ }
70
+
71
+ class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {
11
72
diff --git a/src/vs/loader.js b/src/vs/loader.js
12
73
index 2bf7fe37d7..81cc668f12 100644
13
74
--- a/src/vs/loader.js
@@ -94,6 +155,27 @@ index a43d63aa51..4c6df2fcd9 100644
94
155
});
95
156
});
96
157
});
158
+ diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts
159
+ index ea348f3a04..7c943a71c2 100644
160
+ --- a/src/vs/workbench/electron-browser/window.ts
161
+ +++ b/src/vs/workbench/electron-browser/window.ts
162
+ @@ -38,6 +38,7 @@ import { AccessibilitySupport, isRootUser, isWindows, isMacintosh } from 'vs/bas
163
+ import product from 'vs/platform/node/product';
164
+ import { INotificationService } from 'vs/platform/notification/common/notification';
165
+ import { EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor';
166
+ + import { client } from "../../../../../../packages/vscode";
167
+
168
+ const TextInputActions: IAction[] = [
169
+ new Action('undo', nls.localize('undo', "Undo"), null, true, () => document.execCommand('undo') && Promise.resolve(true)),
170
+ @@ -45,7 +46,7 @@ const TextInputActions: IAction[] = [
171
+ new Separator(),
172
+ new Action('editor.action.clipboardCutAction', nls.localize('cut', "Cut"), null, true, () => document.execCommand('cut') && Promise.resolve(true)),
173
+ new Action('editor.action.clipboardCopyAction', nls.localize('copy', "Copy"), null, true, () => document.execCommand('copy') && Promise.resolve(true)),
174
+ - new Action('editor.action.clipboardPasteAction', nls.localize('paste', "Paste"), null, true, () => document.execCommand('paste') && Promise.resolve(true)),
175
+ + client.pasteAction,
176
+ new Separator(),
177
+ new Action('editor.action.selectAll', nls.localize('selectAll', "Select All"), null, true, () => document.execCommand('selectAll') && Promise.resolve(true))
178
+ ];
97
179
diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts
98
180
index 35bc4a82b3..9cc84bdf28 100644
99
181
--- a/src/vs/workbench/electron-browser/workbench.ts
0 commit comments