]> BookStack Code Mirror - bookstack/blobdiff - resources/js/code/setups.js
Added system cli, and created backups directory
[bookstack] / resources / js / code / setups.js
index 842917285656d9ff5f8e2f39d6e5e91857d61c08..52b9cc199a5b8870eb80e30e11d408441c7e57bc 100644 (file)
@@ -1,9 +1,13 @@
-import {EditorView, keymap, drawSelection, highlightActiveLine, dropCursor,
-    rectangularSelection, lineNumbers, highlightActiveLineGutter} from "@codemirror/view"
-import {bracketMatching} from "@codemirror/language"
-import {defaultKeymap, history, historyKeymap} from "@codemirror/commands"
-import {EditorState} from "@codemirror/state"
-import {getTheme} from "./themes";
+import {
+    EditorView, keymap, drawSelection, highlightActiveLine, dropCursor,
+    rectangularSelection, lineNumbers, highlightActiveLineGutter,
+} from '@codemirror/view';
+import {bracketMatching} from '@codemirror/language';
+import {
+    defaultKeymap, history, historyKeymap, indentWithTab,
+} from '@codemirror/commands';
+import {EditorState} from '@codemirror/state';
+import {getTheme} from './themes';
 
 /**
  * @param {Element} parentEl
@@ -26,7 +30,7 @@ function common(parentEl) {
  * @param {Element} parentEl
  * @return {*[]}
  */
-export function viewer(parentEl) {
+export function viewerExtensions(parentEl) {
     return [
         ...common(parentEl),
         keymap.of([
@@ -40,14 +44,15 @@ export function viewer(parentEl) {
  * @param {Element} parentEl
  * @return {*[]}
  */
-export function editor(parentEl) {
+export function editorExtensions(parentEl) {
     return [
         ...common(parentEl),
         history(),
         keymap.of([
             ...defaultKeymap,
             ...historyKeymap,
+            indentWithTab,
         ]),
         EditorView.lineWrapping,
     ];
-}
\ No newline at end of file
+}