Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Allow toggling read-only mode from tab content https://github.com/siyuan-note/siyuan/issues/19374

Danielca43d9fd1173
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index cfa523b492..e49c6bc751 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -321,6 +321,10 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
if (event.key === "Escape" && !event.isComposing && !event.repeat) {
return;
}
+ // 放行锁定编辑快捷键,由全局快捷键处理器切换只读状态。
+ if (matchHotKey(window.siyuan.config.keymap.general.editReadonly, event)) {
+ return;
+ }
event.stopPropagation();
// 只读页签正文获得焦点后,保留复制快捷键的默认行为。
if (matchHotKey("⌘C", event)) {