diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-02-07 21:36:54 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-02-07 21:36:54 +0100 |
commit | dc415a81259dba1afdc3570c9882288940bd3c29 (patch) | |
tree | 655767587169ff47016d28dad2300d175024b336 /web/pw-server/src/lib/components | |
parent | 4feebe50430236a331b439c31af13d0d390be805 (diff) | |
download | planetwars.dev-dc415a81259dba1afdc3570c9882288940bd3c29.tar.xz planetwars.dev-dc415a81259dba1afdc3570c9882288940bd3c29.zip |
cleanup editor code
Diffstat (limited to 'web/pw-server/src/lib/components')
-rw-r--r-- | web/pw-server/src/lib/components/EditorView.svelte (renamed from web/pw-server/src/lib/components/Editor.svelte) | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/web/pw-server/src/lib/components/Editor.svelte b/web/pw-server/src/lib/components/EditorView.svelte index 5acbca5..c0dd109 100644 --- a/web/pw-server/src/lib/components/Editor.svelte +++ b/web/pw-server/src/lib/components/EditorView.svelte @@ -10,11 +10,15 @@ let editorDiv: HTMLDivElement | undefined; let editor: Ace.Editor | undefined; - onMount(async () => { + onMount(() => { let renderer = new ace.VirtualRenderer(editorDiv); editor = new ace.Editor(renderer, editSession); editor.setTheme(aceGithubTheme); }); + + $: if (editor !== undefined) { + editor.setSession(editSession); + } </script> <div bind:this={editorDiv} class="editor" /> |