aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/src/lib/components
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-02-07 21:36:54 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-02-07 21:36:54 +0100
commitdc415a81259dba1afdc3570c9882288940bd3c29 (patch)
tree655767587169ff47016d28dad2300d175024b336 /web/pw-server/src/lib/components
parent4feebe50430236a331b439c31af13d0d390be805 (diff)
downloadplanetwars.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" />