@@ -137,21 +137,30 @@ Index: code-server/lib/vscode/src/vs/workbench/services/clipboard/browser/clipbo
137
137
===================================================================
138
138
--- code-server.orig/lib/vscode/src/vs/workbench/services/clipboard/browser/clipboardService.ts
139
139
+++ code-server/lib/vscode/src/vs/workbench/services/clipboard/browser/clipboardService.ts
140
- @@ -15,6 +15,7 @@ import { IWorkbenchEnvironmentService }
140
+ @@ -15,19 +15,36 @@ import { IWorkbenchEnvironmentService }
141
141
import { ILogService } from '../../../../platform/log/common/log.js';
142
142
import { ILayoutService } from '../../../../platform/layout/browser/layoutService.js';
143
143
import { getActiveWindow } from '../../../../base/browser/dom.js';
144
144
+ import { isSafari } from '../../../../base/browser/browser.js';
145
+ + import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
145
146
146
147
export class BrowserClipboardService extends BaseBrowserClipboardService {
147
148
148
- @@ -26,8 +27,19 @@ export class BrowserClipboardService ext
149
+ constructor(
150
+ @INotificationService private readonly notificationService: INotificationService,
151
+ + @IContextKeyService private readonly contextKeyService: IContextKeyService,
152
+ @IOpenerService private readonly openerService: IOpenerService,
153
+ @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
154
+ @ILogService logService: ILogService,
149
155
@ILayoutService layoutService: ILayoutService
150
156
) {
151
157
super(layoutService, logService);
152
158
+ if (isSafari) {
153
159
+ window.addEventListener('keydown', event => {
154
- + if (event.key.toLowerCase() === 'p' || (event.key === 'v' && (event.ctrlKey || event.metaKey))) {
160
+ + if (
161
+ + (event.key.toLowerCase() === 'p' && this.contextKeyService.getContextKeyValue('vim.mode') === 'Normal') ||
162
+ + (event.key === 'v' && (event.ctrlKey || event.metaKey) && this.contextKeyService.getContextKeyValue('vim.mode') === 'SearchInProgressMode')
163
+ + ) {
155
164
+ this.lastClipboardTextContent = navigator.clipboard.readText()
156
165
+ this.lastCLipboardTime = Date.now();
157
166
+ }
@@ -165,7 +174,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/clipboard/browser/clipbo
165
174
override async writeText(text: string, type?: string): Promise<void> {
166
175
if (!!this.environmentService.extensionTestsLocationURI && typeof type !== 'string') {
167
176
type = 'vscode-tests'; // force in-memory clipboard for tests to avoid permission issues
168
- @@ -46,6 +58 ,15 @@ export class BrowserClipboardService ext
177
+ @@ -46,6 +63 ,15 @@ export class BrowserClipboardService ext
169
178
}
170
179
171
180
try {
0 commit comments