]> BookStack Code Mirror - bookstack/blobdiff - resources/js/markdown/shortcuts.ts
Deps: Updated PHP composer dependancy versions, fixed test namespaces
[bookstack] / resources / js / markdown / shortcuts.ts
index 734160f29f0353de95140bdc2ada6f6d32ca5b41..175e8f4f04bea7802eb20bc7b9772fdfc0e1e05a 100644 (file)
@@ -1,5 +1,4 @@
 import {MarkdownEditor} from "./index.mjs";
-import {KeyBinding} from "@codemirror/view";
 
 export type MarkdownEditorShortcutMap = Record<string, () => void>;
 
@@ -42,22 +41,3 @@ export function provideShortcutMap(editor: MarkdownEditor): MarkdownEditorShortc
 
     return shortcuts;
 }
-
-/**
- * Get the editor shortcuts in CodeMirror keybinding format.
- */
-export function provideKeyBindings(editor: MarkdownEditor): KeyBinding[] {
-    const shortcuts = provideShortcutMap(editor);
-    const keyBindings = [];
-
-    const wrapAction = (action: ()=>void) => () => {
-        action();
-        return true;
-    };
-
-    for (const [shortcut, action] of Object.entries(shortcuts)) {
-        keyBindings.push({key: shortcut, run: wrapAction(action), preventDefault: true});
-    }
-
-    return keyBindings;
-}