An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: Improve outline dnd https://github.com/siyuan-note/siyuan/issues/10828
Daniel85a3e7cecac2
diff --git a/kernel/model/outline.go b/kernel/model/outline.goindex 8dbb2ca611..74a088d35f 100644--- a/kernel/model/outline.go+++ b/kernel/model/outline.go@@ -87,11 +87,13 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {targetNode := previousHeadingpreviousHeadingChildren := treenode.HeadingChildren(previousHeading)if 0 < len(previousHeadingChildren) {- for _, child := range previousHeadingChildren {- if child.ID == headingID {- break- }- targetNode = child+ targetNode = previousHeadingChildren[len(previousHeadingChildren)-1]+ }++ for _, h := range headingChildren {+ if h.ID == targetNode.ID {+ // 目标节点是当前标题的子节点,不需要移动+ return}}@@ -133,7 +135,6 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {targetNode := parentHeadingparentHeadingChildren := treenode.HeadingChildren(parentHeading)-// 找到下方第一个非标题节点var tmp []*ast.Nodefor _, child := range parentHeadingChildren {@@ -143,7 +144,6 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {tmp = append(tmp, child)}parentHeadingChildren = tmp-if 0 < len(parentHeadingChildren) {for _, child := range parentHeadingChildren {if child.ID == headingID {