Skip to content
Snippets Groups Projects
Commit 005286e1 authored by chris's avatar chris
Browse files

set meta for undo/redo

parent f6b07078
No related branches found
No related tags found
1 merge request!107Tracked transaction
......@@ -27,13 +27,19 @@ const backSpace = chainCommands(
selectNodeBackward
);
const addInputRulebackSpace = (state, dispatch, view) =>
const backSpaceShortCut = (state, dispatch, view) =>
backSpace(
state,
tr => dispatch(tr.setMeta("inputType", "deleteContentBackward")),
view
);
const undoShortCut = (state, dispatch, view) =>
undo(state, tr => dispatch(tr.setMeta("inputType", "historyUndo")), view);
const redoShortCut = (state, dispatch, view) =>
redo(state, tr => dispatch(tr.setMeta("inputType", "historyRedo")), view);
@injectable()
class ShortCuts {
constructor(plugins, schema) {
......@@ -79,10 +85,10 @@ class ShortCuts {
getKeys() {
return {
"Mod-z": undo,
"Shift-Mod-z": redo,
Backspace: addInputRulebackSpace,
"Mod-y": redo,
"Mod-z": undoShortCut,
"Shift-Mod-z": redoShortCut,
Backspace: backSpaceShortCut,
"Mod-y": redoShortCut,
Escape: selectParentNode,
"Mod-Enter": chainCommands(exitCode, this.insertBreak),
"Shift-Enter": chainCommands(exitCode, this.insertBreak),
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment