Skip to content

Commit cba9f28

Browse files
authored
fix(markup): insert tab when selection is empty (#286)
1 parent fd5df40 commit cba9f28

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/markup/codemirror/create.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import {autocompletion} from '@codemirror/autocomplete';
2-
import {defaultKeymap, history, historyKeymap, indentWithTab} from '@codemirror/commands';
2+
import {
3+
defaultKeymap,
4+
history,
5+
historyKeymap,
6+
indentWithTab,
7+
insertTab,
8+
} from '@codemirror/commands';
39
import {syntaxHighlighting} from '@codemirror/language';
410
import type {Extension, StateCommand} from '@codemirror/state';
511
import {EditorView, EditorViewConfig, keymap, placeholder} from '@codemirror/view';
@@ -94,6 +100,7 @@ export function createCodemirror(params: CreateCodemirrorParams) {
94100
return true;
95101
},
96102
},
103+
{key: 'Tab', preventDefault: true, run: insertTab},
97104
indentWithTab,
98105
...defaultKeymap,
99106
...historyKeymap,

0 commit comments

Comments
 (0)