feat: add codeMirror extensions correctly

This commit is contained in:
sethburkart123
2024-10-02 09:21:17 +10:00
parent 53cfb27899
commit 2d325f820d
@@ -1,10 +1,13 @@
<script lang="ts">
import { settingsState } from '@/seqta/utils/listeners/SettingsState'
import { onDestroy, onMount } from 'svelte'
import { EditorState } from '@codemirror/state';
import { highlightSelectionMatches } from '@codemirror/search';
import { indentWithTab, history, defaultKeymap, historyKeymap } from '@codemirror/commands';
import { indentOnInput, indentUnit, bracketMatching, foldKeymap, syntaxHighlighting, defaultHighlightStyle } from '@codemirror/language';
import { closeBrackets, autocompletion, closeBracketsKeymap, completionKeymap } from '@codemirror/autocomplete';
import { highlightSpecialChars, drawSelection, rectangularSelection, crosshairCursor, highlightActiveLine, keymap, EditorView } from '@codemirror/view'; // dropCursor
import { highlightSpecialChars, drawSelection, rectangularSelection, crosshairCursor, highlightActiveLine, keymap, EditorView, dropCursor } from '@codemirror/view';
import { color } from '@uiw/codemirror-extensions-color'
import { Compartment } from '@codemirror/state';
@@ -13,8 +16,6 @@
// Language
import { css } from "@codemirror/lang-css";
import { onDestroy, onMount } from 'svelte'
import { settingsState } from '@/seqta/utils/listeners/SettingsState'
let editor = $state<HTMLDivElement | null>(null)
let view: EditorView | null = null;
@@ -34,6 +35,7 @@
autocompletion(),
rectangularSelection(),
crosshairCursor(),
dropCursor(),
highlightActiveLine(),
highlightSelectionMatches(),
editorTheme.of(githubLight),