diff options
author | silverwind <me@silverwind.io> | 2022-10-20 03:54:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-20 02:54:18 +0100 |
commit | fe442dba4bb09bdc6f92acbe9bb3dee1f5bbf74a (patch) | |
tree | deea9a7116400beafae4c3722eaec84ecad4a666 /web_src/js | |
parent | fbcf1ab477448a41a005af261a88a525308dd652 (diff) | |
download | gitea-fe442dba4bb09bdc6f92acbe9bb3dee1f5bbf74a.tar.gz gitea-fe442dba4bb09bdc6f92acbe9bb3dee1f5bbf74a.zip |
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: https://github.com/go-gitea/gitea/issues/21508
Diffstat (limited to 'web_src/js')
-rw-r--r-- | web_src/js/features/codeeditor.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/web_src/js/features/codeeditor.js b/web_src/js/features/codeeditor.js index a22043c9d4..0366afc2c0 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) { @@ -111,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'); |