🎨 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
5 changed files with 46 additions and 15 deletions
+10 -1
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{}