mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🐛 The maximum number of tags listed is incorrect https://github.com/siyuan-note/siyuan/issues/11320
This commit is contained in:
parent
c6dca1fe0c
commit
0763b550ef
1 changed files with 4 additions and 5 deletions
|
|
@ -226,7 +226,7 @@ func BuildTags() (ret *Tags) {
|
||||||
tmp := &Tags{}
|
tmp := &Tags{}
|
||||||
for _, tag := range tags {
|
for _, tag := range tags {
|
||||||
*tmp = append(*tmp, tag)
|
*tmp = append(*tmp, tag)
|
||||||
total += countTag(tag)
|
countTag(tag, &total)
|
||||||
if Conf.FileTree.MaxListCount < total {
|
if Conf.FileTree.MaxListCount < total {
|
||||||
util.PushMsg(fmt.Sprintf(Conf.Language(243), Conf.FileTree.MaxListCount), 7000)
|
util.PushMsg(fmt.Sprintf(Conf.Language(243), Conf.FileTree.MaxListCount), 7000)
|
||||||
break
|
break
|
||||||
|
|
@ -237,12 +237,11 @@ func BuildTags() (ret *Tags) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func countTag(tag *Tag) int {
|
func countTag(tag *Tag, total *int) {
|
||||||
count := 1
|
*total += 1
|
||||||
for _, child := range tag.tags {
|
for _, child := range tag.tags {
|
||||||
count += countTag(child)
|
countTag(child, total)
|
||||||
}
|
}
|
||||||
return count + tag.Count
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func sortTags(tags Tags) {
|
func sortTags(tags Tags) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue