X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/6b4b500a3313f30c92a8a6ffa1d8427fdf4d2aaa..HEAD:/resources/js/markdown/shortcuts.ts diff --git a/resources/js/markdown/shortcuts.ts b/resources/js/markdown/shortcuts.ts index 734160f29..175e8f4f0 100644 --- a/resources/js/markdown/shortcuts.ts +++ b/resources/js/markdown/shortcuts.ts @@ -1,5 +1,4 @@ import {MarkdownEditor} from "./index.mjs"; -import {KeyBinding} from "@codemirror/view"; export type MarkdownEditorShortcutMap = Record 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; -}