mirror of https://github.com/fantasticit/think.git
feat: insert spaces when tab key down in code-block
This commit is contained in:
parent
3fe45ee80f
commit
98ba8ce098
|
@ -214,6 +214,12 @@ export const BuiltInCodeBlock = Node.create<CodeBlockOptions>({
|
||||||
|
|
||||||
return editor.commands.exitCode();
|
return editor.commands.exitCode();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'Tab': ({ editor }) => {
|
||||||
|
const { selection } = this.editor.state;
|
||||||
|
const { $anchor } = selection;
|
||||||
|
return editor.chain().insertContentAt($anchor.pos, ' ').run();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue