File tree Expand file tree Collapse file tree
meta_configurator/src/components/panels/code-editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ let editor: Ref<Editor | undefined> = ref(undefined);
3535
3636onMounted (() => {
3737 editor .value = ace .edit (editor_id );
38+
39+ editor .value .getSession ().setUseWrapMode (true );
40+ editor .value .setOption (' wrap' , true );
41+ editor .value .setOption (' hScrollBarAlwaysVisible' , false );
42+
3843 setupAceMode (editor .value , settings .value );
3944 setupAceProperties (editor .value , settings .value );
4045
@@ -45,6 +50,13 @@ onMounted(() => {
4550 if (isEditorReadOnly ()) {
4651 editor .value .setReadOnly (true );
4752 }
53+
54+ // watch for changes in the editor container size and resize the editor accordingly
55+ const observer = new ResizeObserver (() => {
56+ editor .value ?.resize ();
57+ });
58+ const el = document .getElementById (editor_id );
59+ if (el ) observer .observe (el );
4860});
4961
5062// watch for changes in the data format and update the editor accordingly
You can’t perform that action at this time.
0 commit comments