Skip to content

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

:art: Improve tree block stat https://github.com/siyuan-note/siyuan/issues/13811

Daniel632dcd08f3c8
diff --git a/kernel/filesys/stat.go b/kernel/filesys/stat.go
index c7538eb24b..baeb9cf277 100644
--- a/kernel/filesys/stat.go
+++ b/kernel/filesys/stat.go
@@ -93,7 +93,7 @@ func statTree(tree *parse.Tree) (ret *util.BlockStatResult) {
blockCount := 0
var databaseBlockNodes []*ast.Node
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
- if !entering {
+ if !entering || tree.Root == n {
return ast.WalkContinue
}