changed code editor width to match all side panels; added auto formatter to the editor

This commit is contained in:
Alexandru Stefan committed 2021-11-22 22:36:02 +02:00
1 parent eb5556a33d
commit f6bff57092
2 files changed
+7 -1

No files matched your search

@@ -123,7 +123,7 @@ function newFoundationsCodeEditorSpace() {
}
function resize() {
thisObject.container.frame.width = 1000
thisObject.container.frame.width = 900
thisObject.container.frame.height = browserCanvas.height // - TOP_SPACE_HEIGHT
thisObject.container.frame.position.x = browserCanvas.width
thisObject.container.frame.position.y = 0 // TOP_SPACE_HEIGHT
@@ -85,6 +85,10 @@ function newFoundationsCodeEditorEditorPage() {
}
createCurrentEditorModel()
// Ensure proper code formatting
monacoEditor.getAction('editor.action.formatDocument').run();
}
@@ -99,6 +103,8 @@ function newFoundationsCodeEditorEditorPage() {
payload.node.code = monacoEditor.getValue()
})
} else if (thisObject.editorType === codeEditorType.CONFIG) {
// monacoEditor.setModel(monaco.editor.createModel(JSON.stringify(payload.node.config, null, 4), "json"))
monacoEditor.setModel(monaco.editor.createModel(payload.node.config, "json"))
//Update config values
monacoEditor.getModel().onDidChangeContent(function () {