From dca0e632a5b3f2257b08b6d8106ca769128a00b0 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 19 Oct 2022 20:51:45 +0200 Subject: [PATCH 1/2] Enable Monaco automaticLayout Fixes: https://github.com/go-gitea/gitea/issues/21508 --- web_src/js/features/codeeditor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/js/features/codeeditor.js b/web_src/js/features/codeeditor.js index a22043c9d4825..e848fb53c75fb 100644 --- a/web_src/js/features/codeeditor.js +++ b/web_src/js/features/codeeditor.js @@ -17,6 +17,7 @@ const baseOptions = { rulers: false, scrollbar: {horizontalScrollbarSize: 6, verticalScrollbarSize: 6}, scrollBeyondLastLine: false, + automaticLayout: true, }; function getEditorconfig(input) { From abc8a51204cdb808c229464b1ccc1b405e16d479 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 19 Oct 2022 22:24:49 +0200 Subject: [PATCH 2/2] remove manual layout --- web_src/js/features/codeeditor.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/web_src/js/features/codeeditor.js b/web_src/js/features/codeeditor.js index e848fb53c75fb..0366afc2c092d 100644 --- a/web_src/js/features/codeeditor.js +++ b/web_src/js/features/codeeditor.js @@ -112,10 +112,6 @@ export async function createMonaco(textarea, filename, editorOpts) { textarea.dispatchEvent(new Event('change')); // seems to be needed for jquery-are-you-sure }); - window.addEventListener('resize', () => { - editor.layout(); - }); - exportEditor(editor); const loading = document.querySelector('.editor-loading');