mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 20:38:49 +01:00
🎨 支持列出和切换最近打开的文档 https://github.com/siyuan-note/siyuan/issues/3293
This commit is contained in:
parent
4cd0e379c5
commit
72419c9075
2 changed files with 14 additions and 0 deletions
|
|
@ -17,6 +17,7 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"github.com/88250/lute/parse"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
|
@ -62,6 +63,17 @@ func RemoveRecentDoc(ids []string) {
|
|||
return
|
||||
}
|
||||
|
||||
func SetRecentDocByTree(tree *parse.Tree) {
|
||||
recentDoc := &RecentDoc{
|
||||
RootID: tree.Root.ID,
|
||||
Icon: tree.Root.IALAttr("icon"),
|
||||
Title: tree.Root.IALAttr("title"),
|
||||
ScrollAttr: tree.Root.IALAttr("scroll"),
|
||||
}
|
||||
|
||||
SetRecentDoc(recentDoc)
|
||||
}
|
||||
|
||||
func SetRecentDoc(doc *RecentDoc) (err error) {
|
||||
recentDocLock.Lock()
|
||||
defer recentDocLock.Unlock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue