Tab-to-indent in editor

This commit is contained in:
Gregory Schier
2024-02-11 14:16:36 -08:00
parent 0a33a32475
commit 27112a39f8

View File

@@ -4,7 +4,7 @@ import {
closeBracketsKeymap, closeBracketsKeymap,
completionKeymap, completionKeymap,
} from '@codemirror/autocomplete'; } from '@codemirror/autocomplete';
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands'; import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';
import { javascript } from '@codemirror/lang-javascript'; import { javascript } from '@codemirror/lang-javascript';
import { json } from '@codemirror/lang-json'; import { json } from '@codemirror/lang-json';
import { xml } from '@codemirror/lang-xml'; import { xml } from '@codemirror/lang-xml';
@@ -133,6 +133,7 @@ export const baseExtensions = [
return (a.boost ?? 0) - (b.boost ?? 0); return (a.boost ?? 0) - (b.boost ?? 0);
}, },
}), }),
keymap.of([indentWithTab]),
syntaxHighlighting(myHighlightStyle), syntaxHighlighting(myHighlightStyle),
myTheme, myTheme,
EditorState.allowMultipleSelections.of(true), EditorState.allowMultipleSelections.of(true),