An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Add two shortcuts for block navigation https://github.com/siyuan-note/siyuan/issues/11193
Daniel4ad53bbeaba4
diff --git a/kernel/model/block.go b/kernel/model/block.goindex 49efec1a58..7725e16256 100644--- a/kernel/model/block.go+++ b/kernel/model/block.go@@ -129,36 +129,76 @@ func GetBlockSiblingID(id string) (parent, previous, next string) {return}+ parentListCount := 0var parentList *ast.Nodefor p := node.Parent; nil != p; p = p.Parent {if ast.NodeList == p.Type {- parentList = p- break+ parentListCount+++ if 1 < parentListCount {+ parentList = p+ break+ }}}if nil != parentList {parent = parentList.ID- if node.Previous != nil {- previous = node.Previous.ID+ if flb := treenode.FirstLeafBlock(parentList); nil != flb {+ parent = flb.ID}- if node.Next != nil {- next = node.Next.ID++ if parentList.Previous != nil {+ previous = parentList.Previous.ID+ if flb := treenode.FirstLeafBlock(parentList.Previous); nil != flb {+ previous = flb.ID+ }+ }+ if parentList.Next != nil {+ next = parentList.Next.ID+ if flb := treenode.FirstLeafBlock(parentList.Next); nil != flb {+ next = flb.ID+ }}return}if nil != node.Parent && node.Parent.IsBlock() {parent = node.Parent.ID- }+ if flb := treenode.FirstLeafBlock(node.Parent); nil != flb {+ parent = flb.ID+ }- if nil != node.Previous && node.Previous.IsBlock() {- previous = node.Previous.ID- }+ if ast.NodeDocument == node.Parent.Type {+ if nil != node.Previous && node.Previous.IsBlock() {+ previous = node.Previous.ID+ if flb := treenode.FirstLeafBlock(node.Previous); nil != flb {+ previous = flb.ID+ }+ }- if nil != node.Next && node.Next.IsBlock() {- next = node.Next.ID+ if nil != node.Next && node.Next.IsBlock() {+ next = node.Next.ID+ if flb := treenode.FirstLeafBlock(node.Next); nil != flb {+ next = flb.ID+ }+ }+ } else {+ if nil != node.Parent.Previous && node.Parent.Previous.IsBlock() {+ previous = node.Parent.Previous.ID+ if flb := treenode.FirstLeafBlock(node.Parent.Previous); nil != flb {+ previous = flb.ID+ }+ }++ if nil != node.Parent.Next && node.Parent.Next.IsBlock() {+ next = node.Parent.Next.ID+ if flb := treenode.FirstLeafBlock(node.Parent.Next); nil != flb {+ next = flb.ID+ }+ }+ }}+return}