From 6235d722d127e7f39ee54dc4e005863966cb574a Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 27 Jan 2023 19:21:56 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E6=94=B9=E8=BF=9B=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=82=B9=E7=9A=84=E6=80=A7=E8=83=BD=20https:?= =?UTF-8?q?//github.com/siyuan-note/siyuan/issues/7177?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/path.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/model/path.go b/kernel/model/path.go index b40396814..d775e706a 100644 --- a/kernel/model/path.go +++ b/kernel/model/path.go @@ -87,7 +87,7 @@ func toFlatTree(blocks []*Block, baseDepth int, typ string) (ret []*Path) { for _, block := range blocks { root := getBlockIn(blockRoots, block.RootID) if nil == root { - root, _ = getBlock(block.RootID) + root, _ = getBlock(block.RootID, nil) blockRoots = append(blockRoots, root) } if nil == root { @@ -134,7 +134,7 @@ func toSubTree(blocks []*Block, keyword string) (ret []*Path) { for _, block := range blocks { root := getBlockIn(blockRoots, block.RootID) if nil == root { - root, _ = getBlock(block.RootID) + root, _ = getBlock(block.RootID, nil) blockRoots = append(blockRoots, root) } block.Depth = 1 @@ -195,11 +195,11 @@ func toSubTree(blocks []*Block, keyword string) (ret []*Path) { } } for next := li.FirstChild.Next; nil != next; next = next.Next { - subBlock, _ := getBlock(next.ID) + subBlock, _ := getBlock(next.ID, tree) if unfold { if ast.NodeList == next.Type { for subLi := next.FirstChild; nil != subLi; subLi = subLi.Next { - subLiBlock, _ := getBlock(subLi.ID) + subLiBlock, _ := getBlock(subLi.ID, tree) var subFirst *sql.Block if 3 != subLi.ListData.Typ { subFirst = sql.GetBlock(subLi.FirstChild.ID) @@ -224,7 +224,7 @@ func toSubTree(blocks []*Block, keyword string) (ret []*Path) { headingChildren := treenode.HeadingChildren(next) var breakSub bool for _, n := range headingChildren { - block, _ := getBlock(n.ID) + block, _ := getBlock(n.ID, tree) subPos := 0 content := block.Content if "" != keyword { @@ -295,7 +295,7 @@ func toSubTree(blocks []*Block, keyword string) (ret []*Path) { for _, headingChild := range headingChildren { if ast.NodeList == headingChild.Type { for subLi := headingChild.FirstChild; nil != subLi; subLi = subLi.Next { - subLiBlock, _ := getBlock(subLi.ID) + subLiBlock, _ := getBlock(subLi.ID, tree) var subFirst *sql.Block if 3 != subLi.ListData.Typ { subFirst = sql.GetBlock(subLi.FirstChild.ID) @@ -315,7 +315,7 @@ func toSubTree(blocks []*Block, keyword string) (ret []*Path) { subRoot.Blocks = append(subRoot.Blocks, subLiBlock) } } else { - subBlock, _ := getBlock(headingChild.ID) + subBlock, _ := getBlock(headingChild.ID, tree) subBlock.Depth = 2 subRoot.Blocks = append(subRoot.Blocks, subBlock) }