fix: don’t use state in KeyboardShortcutCommand anymore
This commit is contained in:
@@ -103,8 +103,8 @@ export const CodeBlock = Node.create<CodeBlockOptions>({
|
|||||||
'Mod-Alt-c': () => this.editor.commands.toggleCodeBlock(),
|
'Mod-Alt-c': () => this.editor.commands.toggleCodeBlock(),
|
||||||
|
|
||||||
// remove code block when at start of document or code block is empty
|
// remove code block when at start of document or code block is empty
|
||||||
Backspace: state => {
|
Backspace: () => {
|
||||||
const { empty, $anchor } = state.selection
|
const { empty, $anchor } = this.editor.state.selection
|
||||||
const isAtStart = $anchor.pos === 1
|
const isAtStart = $anchor.pos === 1
|
||||||
|
|
||||||
if (!empty || $anchor.parent.type.name !== 'codeBlock') {
|
if (!empty || $anchor.parent.type.name !== 'codeBlock') {
|
||||||
|
|||||||
Reference in New Issue
Block a user