@@ -137,18 +137,20 @@ 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,19 +15,36 @@ import { IWorkbenchEnvironmentService }
140
+ @@ -15,19 +15,38 @@ 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
145
+ import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
146
+ + import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js';
146
147
147
148
export class BrowserClipboardService extends BaseBrowserClipboardService {
148
149
149
150
constructor(
150
151
@INotificationService private readonly notificationService: INotificationService,
151
152
+ @IContextKeyService private readonly contextKeyService: IContextKeyService,
153
+ + @ICodeEditorService private readonly codeEditorService: ICodeEditorService,
152
154
@IOpenerService private readonly openerService: IOpenerService,
153
155
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
154
156
@ILogService logService: ILogService,
@@ -158,7 +160,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/clipboard/browser/clipbo
158
160
+ if (isSafari) {
159
161
+ window.addEventListener('keydown', event => {
160
162
+ if (
161
- + (event.key.toLowerCase() === 'p' && this.contextKeyService.getContextKeyValue('vim.mode') === 'Normal') ||
163
+ + (event.key.toLowerCase() === 'p' && this.contextKeyService.getContextKeyValue('vim.mode') === 'Normal' && this.codeEditorService.getActiveCodeEditor()?.hasTextFocus() ) ||
162
164
+ (event.key === 'v' && (event.ctrlKey || event.metaKey) && this.contextKeyService.getContextKeyValue('vim.mode') === 'SearchInProgressMode')
163
165
+ ) {
164
166
+ this.lastClipboardTextContent = navigator.clipboard.readText()
@@ -174,7 +176,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/clipboard/browser/clipbo
174
176
override async writeText(text: string, type?: string): Promise<void> {
175
177
if (!!this.environmentService.extensionTestsLocationURI && typeof type !== 'string') {
176
178
type = 'vscode-tests'; // force in-memory clipboard for tests to avoid permission issues
177
- @@ -46,6 +63 ,15 @@ export class BrowserClipboardService ext
179
+ @@ -46,6 +65 ,15 @@ export class BrowserClipboardService ext
178
180
}
179
181
180
182
try {
0 commit comments