From 0d3bd719aa1c1cc7c6ea9e65be86c17972014e3e Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 11 Dec 2022 00:14:06 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=AF=E6=8C=81=E5=88=97=E5=87=BA?= =?UTF-8?q?=E5=92=8C=E5=88=87=E6=8D=A2=E6=9C=80=E8=BF=91=E6=89=93=E5=BC=80?= =?UTF-8?q?=E7=9A=84=E6=96=87=E6=A1=A3=20https://github.com/siyuan-note/si?= =?UTF-8?q?yuan/issues/3293?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/file.go | 2 +- kernel/model/storage.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/model/file.go b/kernel/model/file.go index 577e3d628..2e5f800c3 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -660,7 +660,7 @@ func GetDoc(startID, endID, id string, index int, keyword string, mode int, size luteEngine.RenderOptions.NodeIndexStart = index dom = luteEngine.Tree2BlockDOM(subTree, luteEngine.RenderOptions) - SetRecentDocByTree(tree) + SetRecentDocByTree(id, tree) return } diff --git a/kernel/model/storage.go b/kernel/model/storage.go index 5f0527467..e84fc4501 100644 --- a/kernel/model/storage.go +++ b/kernel/model/storage.go @@ -30,6 +30,7 @@ import ( type RecentDoc struct { RootID string `json:"rootID"` + ID string `json:"id"` Icon string `json:"icon"` Title string `json:"title"` ScrollAttr string `json:"scrollAttr"` @@ -63,9 +64,10 @@ func RemoveRecentDoc(ids []string) { return } -func SetRecentDocByTree(tree *parse.Tree) { +func SetRecentDocByTree(id string, tree *parse.Tree) { recentDoc := &RecentDoc{ RootID: tree.Root.ID, + ID: id, Icon: tree.Root.IALAttr("icon"), Title: tree.Root.IALAttr("title"), ScrollAttr: tree.Root.IALAttr("scroll"),