Skip to content

Commit fe442db

Browse files
authored
Enable Monaco automaticLayout (#21515)
Enable [`automaticLayout`](https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.IDiffEditorOptions.html#automaticLayout) for monaco so it can reflow itself. Fixes: #21508
1 parent fbcf1ab commit fe442db

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

web_src/js/features/codeeditor.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const baseOptions = {
1717
rulers: false,
1818
scrollbar: {horizontalScrollbarSize: 6, verticalScrollbarSize: 6},
1919
scrollBeyondLastLine: false,
20+
automaticLayout: true,
2021
};
2122

2223
function getEditorconfig(input) {
@@ -111,10 +112,6 @@ export async function createMonaco(textarea, filename, editorOpts) {
111112
textarea.dispatchEvent(new Event('change')); // seems to be needed for jquery-are-you-sure
112113
});
113114

114-
window.addEventListener('resize', () => {
115-
editor.layout();
116-
});
117-
118115
exportEditor(editor);
119116

120117
const loading = document.querySelector('.editor-loading');

0 commit comments

Comments
 (0)