Skip to content

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

:bug: Preserve word counts in block selection mode https://github.com/siyuan-note/siyuan/issues/19720

Daniel5c897311cf62
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index aef0a1e520..55266f2615 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -4392,6 +4392,13 @@ export class WYSIWYG {
arrowStartElement = undefined;
}
+ if (getBlockSelectionModeElement(this.element)) {
+ // 块选择模式使用块统计,避免松开按键后被光标所在的文本选区统计覆盖。
+ this.preventKeyup = false;
+ event.stopPropagation();
+ return;
+ }
+
if (!event.altKey && !event.shiftKey && !event.ctrlKey && !event.metaKey && !event.isComposing &&
event.key.startsWith("Arrow") && shouldRunAVKeyupFallback(this.preventKeyup,
!!isArrowFromOutsideAV) &&