From c1bdf59a6d3ec3c6e4c355d4c9bddca9c7a99f00 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 5 Oct 2022 11:16:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:bug:=20=E5=88=97=E8=A1=A8=E9=A1=B9?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E5=BC=95=E7=94=A8=E6=A0=87=E9=A2=98=E5=B8=A6?= =?UTF-8?q?=E5=AD=90=E7=BA=A7=20https://github.com/siyuan-note/insider/iss?= =?UTF-8?q?ues/1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/block.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/model/block.go b/kernel/model/block.go index c99d5f55a..36455f39a 100644 --- a/kernel/model/block.go +++ b/kernel/model/block.go @@ -179,6 +179,9 @@ func SwapBlockRef(refID, defID string, includeChildren bool) (err error) { li.SetIALAttr("id", newID) li.SetIALAttr("updated", newID[:14]) li.AppendChild(defNode) + for i := len(defNodeChildren) - 1; -1 < i; i-- { + defNode.InsertAfter(defNodeChildren[i]) + } refPivot.InsertAfter(li) } else { defNode.InsertAfter(refNode) From 05661f4983b93e3233c36eb917d59c19cf652683 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 5 Oct 2022 11:56:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?:art:=20=E6=96=87=E6=A1=A3=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=BB=9F=E8=AE=A1=E5=A2=9E=E5=8A=A0=E8=B6=85=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E6=95=B0=E3=80=81=E5=9B=BE=E7=89=87=E6=95=B0=E3=80=81?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E6=95=B0=E5=92=8C=E5=A4=A7=E5=B0=8F=20https:?= =?UTF-8?q?//github.com/siyuan-note/siyuan/issues/6037?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/file.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/model/file.go b/kernel/model/file.go index 8f36679ec..aa90e7c40 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -431,6 +431,8 @@ func BlocksWordCount(ids []string) (ret *util.BlockStatResult) { } func StatTree(id string) (ret *util.BlockStatResult) { + WaitForWritingFiles() + tree, _ := loadTreeByBlockID(id) if nil == tree { return