diff --git a/src/tools.ts b/src/tools.ts index 26498fc..20fcfbf 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -1,5 +1,5 @@ import * as monaco from 'monaco-editor' -import { ContextKeyExpr, DisposableStore, KeybindingsRegistry } from 'vscode/monaco' +import { DisposableStore } from 'vscode/monaco' interface PastePayload { text: string @@ -497,32 +497,6 @@ export function mapClipboard ( const disposableStore = new DisposableStore() let copiedText = '' - disposableStore.add( - KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'customCopy', - weight: 1000, - handler: () => { - copiedText = editor.getModel()!.getValueInRange(editor.getSelection()!) - document.execCommand('copy') - }, - when: ContextKeyExpr.equals('editorId', editor.getId()), - primary: monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyC - }) - ) - - disposableStore.add( - KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'customCut', - weight: 1000, - handler: () => { - copiedText = editor.getModel()!.getValueInRange(editor.getSelection()!) - document.execCommand('cut') - }, - when: ContextKeyExpr.equals('editorId', editor.getId()), - primary: monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyX - }) - ) - const originalTrigger = editor.trigger editor.trigger = function (source, handlerId, payload) { if (handlerId === 'editor.action.clipboardCopyAction') {