Use explicit key bindings for copy/paste/cut, instead of just relying on default browser keys

This commit is contained in:
Jonatan Heyman 2024-01-29 13:20:21 +01:00
parent a5088a48af
commit f9673b0954

View File

@ -16,6 +16,7 @@ import {
selectNextParagraph, selectPreviousParagraph,
newCursorBelow, newCursorAbove,
} from "./block/commands.js"
import { pasteCommand, copyCommand, cutCommand } from "./copy-paste.js"
import { formatBlockContent } from "./block/format-code.js"
@ -41,6 +42,9 @@ export function keymapFromSpec(specs) {
export function heynoteKeymap(editor) {
return keymapFromSpec([
["Mod-c", copyCommand(editor)],
["Mod-v", pasteCommand],
["Mod-x", cutCommand(editor)],
["Tab", indentMore],
["Shift-Tab", indentLess],
["Alt-Shift-Enter", addNewBlockBeforeFirst],