From fab1323576da3487b733bce4268cff3be1fb7583 Mon Sep 17 00:00:00 2001 From: ankushKun Date: Tue, 28 May 2024 12:39:48 +0530 Subject: [PATCH] shift enter to run --- next_app/src/components/layout.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/next_app/src/components/layout.tsx b/next_app/src/components/layout.tsx index de2a117..7b954d0 100644 --- a/next_app/src/components/layout.tsx +++ b/next_app/src/components/layout.tsx @@ -209,7 +209,7 @@ const CodeCell = ({ // editor.updateOptions({ fontFamily: "DM Mono" }); // monaco.editor.remeasureFonts(); // run function on ctrl+enter - editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, () => { + editor.addCommand(monaco.KeyMod.Shift | monaco.KeyCode.Enter, () => { runCellCode(); }); }} @@ -324,7 +324,7 @@ const VisualCell = ( // editor.updateOptions({ fontFamily: "DM Mono" }); // monaco.editor.remeasureFonts(); // run function on ctrl+enter - editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, () => { + editor.addCommand(monaco.KeyMod.Shift | monaco.KeyCode.Enter, () => { setEditing(false); }); editor.focus(); @@ -537,6 +537,10 @@ $$\\int_a^b f'(x) dx = f(b)- f(a)$$`, // set font family // editor.updateOptions({ fontFamily: "DM Mono" }); // monaco.editor.remeasureFonts(); + // run function on shift+enter + editor.addCommand(monaco.KeyMod.Shift | monaco.KeyCode.Enter, () => { + runNormalCode(); + }); }} value={file ? file.content.cells[0].code : ""} onChange={(value) => {