From 6461d432f278839a55c50d173d8a2b9e346e8d41 Mon Sep 17 00:00:00 2001 From: Michael Ochmann Date: Sat, 3 Feb 2024 00:42:48 +0100 Subject: [PATCH] added clipboard actions for some reason, we had to add the "copy", "cut" and "paste" keybindings ouselves. i do not know why that is, but it works now. --- src/ui/src/components/Editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ui/src/components/Editor.js b/src/ui/src/components/Editor.js index b6bded4..5f48ed6 100644 --- a/src/ui/src/components/Editor.js +++ b/src/ui/src/components/Editor.js @@ -25,7 +25,10 @@ const Editor = ({show, source}) => { }; }, [mode]); - const editorMount = (instance, _) => { + const editorMount = (instance, monaco) => { + instance.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyC, () => instance.trigger("source","editor.action.clipboardCopyAction")); + instance.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyV, () => instance.trigger("source","editor.action.clipboardPasteAction")); + instance.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyX, () => instance.trigger("source","editor.action.clipboardCutAction")); editor.current = instance; }