You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve looked at the playground.js file to see how to resize the editor but I can’t figure it out after 3 hours of playing with it. I can’t find an interface on the editor to allow the resizing or an explanation of all the layout elements of the container.
Using this snippet of code itself doesn’t seem to work:
if (editor) {
editor.layout({
width: HALF_WIDTH - 2,
height: (REMAINING_HEIGHT - TABS_HEIGHT) - 1
});
}
I seem to be running into an issue with the overflow container size versus the editor size versus the container size and getting the three of them to be in alignment with each other in a way that works is stumping me.
The text was updated successfully, but these errors were encountered:
var editor = monaco.editor.create(container, {});
...
function setSize(w, h) {
container.style.width = w + 'px';
container.style.height = h + 'px';
// A. When the dimension is not specified explicitly,
// the editor will scan the container for the container's
// new size, causing a forced layout, which is possibly undersirable
editor.layout();
// B. The editor does not need to scan the container,
// avoiding a forced layout
editor.layout({ width: w, height: h});
}
just in case , my needs are different: I want the user to resize it the container - in a standard way and cheap (both on code and performance) on libraries and performance. This is what I did:
yes, 2 seconds interval and make sure it registers only once. I see there is / was a resize interval on 100ms for the automatic relayout in monaco - IMHO that's too much.
I’ve looked at the playground.js file to see how to resize the editor but I can’t figure it out after 3 hours of playing with it. I can’t find an interface on the editor to allow the resizing or an explanation of all the layout elements of the container.
Using this snippet of code itself doesn’t seem to work:
if (editor) {
editor.layout({
width: HALF_WIDTH - 2,
height: (REMAINING_HEIGHT - TABS_HEIGHT) - 1
});
}
I seem to be running into an issue with the overflow container size versus the editor size versus the container size and getting the three of them to be in alignment with each other in a way that works is stumping me.
The text was updated successfully, but these errors were encountered: