From 082b9000ab44a9816c5c53534af54d47b5dd9c39 Mon Sep 17 00:00:00 2001 From: inaseem Date: Mon, 4 Oct 2021 17:33:01 +0530 Subject: [PATCH] Fixed a few bugs with monaco language setting --- frontend/components/Layouts.js | 2 +- frontend/pages/editor/[lang].js | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/frontend/components/Layouts.js b/frontend/components/Layouts.js index 8916575..67152f9 100644 --- a/frontend/components/Layouts.js +++ b/frontend/components/Layouts.js @@ -21,7 +21,7 @@ const Layouts = (props) => { ? { display: "flex", flexDirection: "row", alignItems: "stretch" } : {}), }} - onDragEnd={() => EventEmitter.dispatch("resize")} + onDrag={() => EventEmitter.dispatch("resize")} > {children} diff --git a/frontend/pages/editor/[lang].js b/frontend/pages/editor/[lang].js index b932ad0..a8ab2f2 100644 --- a/frontend/pages/editor/[lang].js +++ b/frontend/pages/editor/[lang].js @@ -323,11 +323,6 @@ const CodeRunner = (props) => { showValue(); }, }); - editor.getModel().setValue(config.template + "\n"); - monaco.editor.setModelLanguage( - editor.getModel(), - config.monacoLang || "plaintext" - ); // Below code is just for adding an empty line in editor monaco.languages.registerCodeLensProvider( config.monacoLang || "plaintext", @@ -532,8 +527,8 @@ const CodeRunner = (props) => { { // let lsp = langs.javascript; // if (query.lang) lsp = langs[query.lang]; // return { -// props: { lsp }, // will be passed to the page component as props +// props: { langConfig: lsp }, // will be passed to the page component as props // }; // }