File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 5050//
5151// ### Third-party
5252import { basicSetup } from "codemirror" ;
53+ import { indentWithTab } from "@codemirror/commands" ;
5354import {
5455 EditorView ,
5556 Decoration ,
5657 DecorationSet ,
58+ keymap ,
5759 ViewUpdate ,
5860 ViewPlugin ,
5961 WidgetType ,
@@ -99,8 +101,8 @@ let tinymce_singleton: Editor | undefined;
99101// When true, don't update on the next call to `on_dirty`. See that function for
100102// more info.
101103let ignore_next_dirty = false ;
102- // True to ignore the next text selection change, since updates to the
103- // cursor or scroll position from the Client trigged this change.
104+ // True to ignore the next text selection change, since updates to the cursor or
105+ // scroll position from the Client trigged this change.
104106let ignore_selection_change = false ;
105107
106108// Options used when creating a `Decoration`.
@@ -984,6 +986,10 @@ export const CodeMirror_load = async (
984986 basicSetup ,
985987 EditorView . lineWrapping ,
986988 autosaveExtension ,
989+ // Make tab an indent per the
990+ // [docs](https://codemirror.net/examples/tab/). TODO:
991+ // document a way to escape the tab key per the same docs.
992+ keymap . of ( [ indentWithTab ] ) ,
987993 ...extensions ,
988994 ] ,
989995 } ,
You can’t perform that action at this time.
0 commit comments