MCPcopy Create free account
hub / github.com/Auto-Plugin/milkup / handleSourceTextKeydown

Method handleSourceTextKeydown

src/core/nodeviews/code-block.ts:1023–1030  ·  view source on GitHub ↗

* 处理源码文本键盘事件

(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

1021 * 处理源码文本键盘事件
1022 */
1023 private handleSourceTextKeydown(e: KeyboardEvent): void {
1024 // 允许基本的编辑操作
1025 if (e.key === "Tab") {
1026 e.preventDefault();
1027 // 插入两个空格
1028 document.execCommand("insertText", false, " ");
1029 }
1030 }
1031
1032 /**
1033 * 创建头部(语言选择器和 Mermaid 模式选择器)

Callers 1

setSourceViewModeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected