mirror of
https://github.com/fantasticit/think.git
synced 2026-10-30 22:56:06 +08:00
feat: insert spaces when tab key down in code-block
This commit is contained in:
@@ -214,6 +214,12 @@ export const BuiltInCodeBlock = Node.create<CodeBlockOptions>({
|
||||
|
||||
return editor.commands.exitCode();
|
||||
},
|
||||
|
||||
'Tab': ({ editor }) => {
|
||||
const { selection } = this.editor.state;
|
||||
const { $anchor } = selection;
|
||||
return editor.chain().insertContentAt($anchor.pos, ' ').run();
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user