add some more commands

This commit is contained in:
Philipp Kühn
2020-09-21 23:17:30 +02:00
parent 778e064979
commit 4da71ecfbb
27 changed files with 207 additions and 210 deletions

View File

@@ -18,19 +18,19 @@ export default new Node()
],
toDOM: () => ['br'],
}))
.commands(({ editor, type }) => ({
hardBreak: next => () => {
const { state, view } = editor
const { dispatch } = view
// .commands(({ editor, type }) => ({
// hardBreak: next => () => {
// const { state, view } = editor
// const { dispatch } = view
chainCommands(exitCode, () => {
dispatch(state.tr.replaceSelectionWith(type.create()).scrollIntoView())
return true
})(state, dispatch, view)
// chainCommands(exitCode, () => {
// dispatch(state.tr.replaceSelectionWith(type.create()).scrollIntoView())
// return true
// })(state, dispatch, view)
next()
},
}))
// next()
// },
// }))
.keys(({ editor }) => ({
'Mod-Enter': () => editor.hardBreak(),
'Shift-Enter': () => editor.hardBreak(),