I have a code to create an editor in an AngularJS directive:
function newMonacoeditorEditor(iElement, monacoeditorOptions) {
var editor = monaco.editor.create(iElement[0], {
language: monacoeditorOptions.language,
lineNumbers: monacoeditorOptions.lineNumbers
});
console.log("newMonacoeditorEditor")
return editor
}
I would like to know how to always disable the minimap?
Thank you
e.g.
monaco.editor.create(document.getElementById("container"), {
value: "function hello() {\n\talert('Hello world!');\n}",
language: "javascript",
minimap: {
enabled: false
}
});
It works, thank you very much @alexandrudima
How does one disable minimap once the editor has been created?
@David-Carty You can use the updateOptions API for that.
editor = monaco.editor.create(document.getElementById("container"), {
value: "function hello() {\n\talert('Hello world!');\n}",
language: "javascript",
minimap: {
enabled: true
}
});
setTimeout(() => {
alert("Disabling")
editor.updateOptions({
minimap: {
enabled: false
}
})
}, 3000);
Thank you. Is there anyway of detecting if the minimap is enabled as I want to create a toggle?
@David-Carty You can track the minimap enablement on your side in a variable.
Most helpful comment
e.g.