mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-28 09:54:07 +01:00
🎨 Improve doc tree Name Alphabet sorting https://github.com/siyuan-note/siyuan/issues/14773
This commit is contained in:
parent
e46c998a6b
commit
b35e21587b
3 changed files with 38 additions and 4 deletions
|
|
@ -148,11 +148,11 @@ func ListNotebooks() (ret []*Box, err error) {
|
|||
switch Conf.FileTree.Sort {
|
||||
case util.SortModeNameASC:
|
||||
sort.Slice(ret, func(i, j int) bool {
|
||||
return util.PinYinCompare(ret[i].Name, ret[j].Name)
|
||||
return util.PinYinCompare4FileTree(ret[i].Name, ret[j].Name)
|
||||
})
|
||||
case util.SortModeNameDESC:
|
||||
sort.Slice(ret, func(i, j int) bool {
|
||||
return util.PinYinCompare(ret[j].Name, ret[i].Name)
|
||||
return util.PinYinCompare4FileTree(ret[j].Name, ret[i].Name)
|
||||
})
|
||||
case util.SortModeAlphanumASC:
|
||||
sort.Slice(ret, func(i, j int) bool {
|
||||
|
|
|
|||
|
|
@ -372,11 +372,11 @@ func ListDocTree(boxID, listPath string, sortMode int, flashcard, showHidden boo
|
|||
switch sortMode {
|
||||
case util.SortModeNameASC:
|
||||
sort.Slice(docs, func(i, j int) bool {
|
||||
return util.PinYinCompare(docs[i].Name, docs[j].Name)
|
||||
return util.PinYinCompare4FileTree(docs[i].Name, docs[j].Name)
|
||||
})
|
||||
case util.SortModeNameDESC:
|
||||
sort.Slice(docs, func(i, j int) bool {
|
||||
return util.PinYinCompare(docs[j].Name, docs[i].Name)
|
||||
return util.PinYinCompare4FileTree(docs[j].Name, docs[i].Name)
|
||||
})
|
||||
case util.SortModeUpdatedASC:
|
||||
sort.Slice(docs, func(i, j int) bool { return docs[i].Mtime < docs[j].Mtime })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue