diff options
author | Jakob Stendahl <jakobste@uio.no> | 2021-10-21 19:29:00 +0200 |
---|---|---|
committer | Jakob Stendahl <jakobste@uio.no> | 2021-10-21 19:29:00 +0200 |
commit | 1cba96c40a79ae5bed0754f25f55f4b089289857 (patch) | |
tree | 2336bc00c36b846c82759a1015d6a1866b7b4539 | |
parent | 6e53fd0dfd830d6d96206419c530c71fa4b3f4e6 (diff) | |
download | Luxcena-Neo-1cba96c40a79ae5bed0754f25f55f4b089289857.tar.gz Luxcena-Neo-1cba96c40a79ae5bed0754f25f55f4b089289857.zip |
:construction: Fix tab width of editor
-rw-r--r-- | src_frontend/Components/Editor/Editor.svelte | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src_frontend/Components/Editor/Editor.svelte b/src_frontend/Components/Editor/Editor.svelte index 1876bf6..fc5d589 100644 --- a/src_frontend/Components/Editor/Editor.svelte +++ b/src_frontend/Components/Editor/Editor.svelte @@ -4,13 +4,15 @@ <script> import { onDestroy } from "svelte"; import { pop } from "svelte-spa-router"; - import { EditorState, EditorView, basicSetup } from "@codemirror/basic-setup" + import { EditorState, basicSetup } from "@codemirror/basic-setup" + import { EditorView, keymap } from "@codemirror/view" + import { indentWithTab } from "@codemirror/commands" + import { indentUnit } from '@codemirror/language' import { python } from "@codemirror/lang-python" import { HighlightStyle, tags as t } from "@codemirror/highlight" import { notif } from "../../stores/notifs"; import TopBar from "./TopBar.svelte"; import Pane from "./Pane.svelte"; - import ControlComponents from "../MainControls/ControlComponents.svelte"; import Controls from "./Controls.svelte"; import Output from "./Output.svelte"; import Simulation from "./Simulation.svelte"; @@ -53,8 +55,10 @@ codeEditorView = new EditorView({ state: EditorState.create({ extensions: [ - basicSetup, + basicSetup, + keymap.of([indentWithTab]), python(), + indentUnit.of(" "), EditorView.updateListener.of(update => { if (update.docChanged) { codeEditorHasChanges = true; |