🎨 Backlink and backmention sort mode persistence (#16291)

fix https://github.com/siyuan-note/siyuan/issues/7764
This commit is contained in:
Jeffrey Chen 2025-11-06 09:33:20 +08:00 committed by GitHub
parent f45f2c7cdb
commit d14501178d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 46 additions and 15 deletions

View file

@ -229,8 +229,17 @@ func InitConf() {
Conf.Tag = conf.NewTag()
}
defaultEditor := conf.NewEditor()
if nil == Conf.Editor {
Conf.Editor = conf.NewEditor()
Conf.Editor = defaultEditor
}
// 新增字段的默认值
// 使用指针类型来区分字段不存在nil和用户设置为 0非 nil
if nil == Conf.Editor.BacklinkSort {
Conf.Editor.BacklinkSort = defaultEditor.BacklinkSort
}
if nil == Conf.Editor.BackmentionSort {
Conf.Editor.BackmentionSort = defaultEditor.BackmentionSort
}
if 1 > len(Conf.Editor.Emoji) {
Conf.Editor.Emoji = []string{}