Skip to content

Commit

Permalink
cleanup: remove useless deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Feb 27, 2024
1 parent 4676eae commit cf293d6
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/tools.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit cf293d6

Please sign in to comment.