Skip to content

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

:art: Improve list block navigation https://github.com/siyuan-note/siyuan/issues/11193

Daniela37bc3335de4
diff --git a/kernel/model/block.go b/kernel/model/block.go
index 8dc749a0f7..ee3dbfa876 100644
--- a/kernel/model/block.go
+++ b/kernel/model/block.go
@@ -130,12 +130,11 @@ func GetBlockSiblingID(id string) (parent, previous, next string) {
}
parentListCount := 0
- var parentList, parentListItem, current *ast.Node
+ var parentListItem, current *ast.Node
for p := node.Parent; nil != p; p = p.Parent {
if ast.NodeListItem == p.Type {
parentListCount++
if 1 < parentListCount {
- parentList = p.Parent
parentListItem = p
break
}
@@ -143,9 +142,9 @@ func GetBlockSiblingID(id string) (parent, previous, next string) {
}
}
- if nil != parentList {
- parent = parentList.ID
- if flb := firstChild(parentList); nil != flb {
+ if nil != parentListItem {
+ parent = parentListItem.ID
+ if flb := firstChild(parentListItem); nil != flb {
parent = flb.ID
}