🎨 Supports configuring the maximum number of Recent documents to be listed https://github.com/siyuan-note/siyuan/issues/16720

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-12-29 22:24:37 +08:00
parent cde0840bf7
commit 827c7a5bf6
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
27 changed files with 61 additions and 7 deletions

View file

@ -236,6 +236,13 @@ func InitConf() {
Conf.FileTree.CreateDocAtTop = func() *bool { b := true; return &b }()
}
if 1 > Conf.FileTree.RecentDocsMaxListCount {
Conf.FileTree.RecentDocsMaxListCount = 32
}
if 256 < Conf.FileTree.RecentDocsMaxListCount {
Conf.FileTree.RecentDocsMaxListCount = 256
}
util.CurrentCloudRegion = Conf.CloudRegion
if nil == Conf.Tag {

View file

@ -99,8 +99,8 @@ func setRecentDocByTree(tree *parse.Tree) {
}
recentDocs = append([]*RecentDoc{recentDoc}, recentDocs...)
if 32 < len(recentDocs) {
recentDocs = recentDocs[:32]
if Conf.FileTree.RecentDocsMaxListCount < len(recentDocs) {
recentDocs = recentDocs[:Conf.FileTree.RecentDocsMaxListCount]
}
err = setRecentDocs(recentDocs)