File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,11 @@ import { oneDark } from "@codemirror/theme-one-dark";
1919import { lineNumbers , keymap } from " @codemirror/view" ;
2020import { autocompletion , closeBrackets } from " @codemirror/autocomplete" ;
2121import { searchKeymap , highlightSelectionMatches } from " @codemirror/search" ;
22- import { defaultKeymap , historyKeymap } from " @codemirror/commands" ;
22+ import {
23+ defaultKeymap ,
24+ historyKeymap ,
25+ indentWithTab ,
26+ } from " @codemirror/commands" ;
2327import { bracketMatching } from " @codemirror/language" ;
2428
2529// 语言支持
@@ -138,7 +142,12 @@ const createEditor = () => {
138142 themeCompartment .of (props .theme === " dark" ? oneDark : []),
139143
140144 // 键盘快捷键
141- keymap .of ([... defaultKeymap , ... historyKeymap , ... searchKeymap ]),
145+ keymap .of ([
146+ ... defaultKeymap ,
147+ ... historyKeymap ,
148+ ... searchKeymap ,
149+ indentWithTab ,
150+ ]),
142151
143152 // 编辑器功能
144153 EditorView .lineWrapping , // 自动换行
You can’t perform that action at this time.
0 commit comments