🎨 Improve tab insertion with Tab key (#17169)

This commit is contained in:
Jeffrey Chen 2026-03-09 22:13:57 +08:00 committed by GitHub
parent f7efba8436
commit ae11fee5c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1884,7 +1884,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
return;
}
if (!event.shiftKey) {
document.execCommand("insertText", false, window.siyuan.config.editor.codeTabSpaces === 0 ? "\t" : "".padStart(window.siyuan.config.editor.codeTabSpaces, " "));
document.execCommand("insertHTML", false, window.siyuan.config.editor.codeTabSpaces === 0 ? "\t" : "".padStart(window.siyuan.config.editor.codeTabSpaces, " "));
return true;
}
}