fix: don’t use state in KeyboardShortcutCommand anymore

This commit is contained in:
Philipp Kühn
2021-04-20 23:01:06 +02:00
parent 046d1ccb3b
commit 92ced9f998

View File

@@ -103,8 +103,8 @@ export const CodeBlock = Node.create<CodeBlockOptions>({
'Mod-Alt-c': () => this.editor.commands.toggleCodeBlock(),
// remove code block when at start of document or code block is empty
Backspace: state => {
const { empty, $anchor } = state.selection
Backspace: () => {
const { empty, $anchor } = this.editor.state.selection
const isAtStart = $anchor.pos === 1
if (!empty || $anchor.parent.type.name !== 'codeBlock') {