From 0763b550efcd30b8b2d181c147a351b23a045696 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 9 May 2024 11:40:32 +0800 Subject: [PATCH] :bug: The maximum number of tags listed is incorrect https://github.com/siyuan-note/siyuan/issues/11320 --- kernel/model/tag.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/kernel/model/tag.go b/kernel/model/tag.go index b45bfb12d..0b8fbf09b 100644 --- a/kernel/model/tag.go +++ b/kernel/model/tag.go @@ -226,7 +226,7 @@ func BuildTags() (ret *Tags) { tmp := &Tags{} for _, tag := range tags { *tmp = append(*tmp, tag) - total += countTag(tag) + countTag(tag, &total) if Conf.FileTree.MaxListCount < total { util.PushMsg(fmt.Sprintf(Conf.Language(243), Conf.FileTree.MaxListCount), 7000) break @@ -237,12 +237,11 @@ func BuildTags() (ret *Tags) { return } -func countTag(tag *Tag) int { - count := 1 +func countTag(tag *Tag, total *int) { + *total += 1 for _, child := range tag.tags { - count += countTag(child) + countTag(child, total) } - return count + tag.Count } func sortTags(tags Tags) {