feat(editor): support tab indentation

This commit is contained in:
t8y2
2026-05-09 15:58:28 +08:00
parent f9993dd3f8
commit b8b4ef2e5a
3 changed files with 7 additions and 0 deletions
+3
View File
@@ -210,12 +210,14 @@ onMounted(async () => {
{ sql, MySQL, PostgreSQL, SQLDialect },
{ basicSetup },
{ autocompletion, startCompletion },
{ indentWithTab },
] = await Promise.all([
import("@codemirror/view"),
import("@codemirror/state"),
import("@codemirror/lang-sql"),
import("codemirror"),
import("@codemirror/autocomplete"),
import("@codemirror/commands"),
]);
editorViewModule = { EditorView, keymap } as typeof import("@codemirror/view");
fontThemeComp = new Compartment();
@@ -281,6 +283,7 @@ onMounted(async () => {
override: [async (context: CompletionContext) => provideSqlCompletions(context.state, context.pos)],
}),
codeMirrorTheme.of(theme),
keymap.of([indentWithTab]),
runKeymap,
EditorView.updateListener.of((update) => {
if (update.docChanged) {