🎨 Database .json follows the doc tree single line save setting https://github.com/siyuan-note/siyuan/issues/10571

This commit is contained in:
Daniel 2024-03-11 21:31:29 +08:00
parent 8675b49daa
commit 7f82fc21af
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
7 changed files with 12 additions and 7 deletions

View file

@ -468,7 +468,12 @@ func SaveAttributeView(av *AttributeView) (err error) {
}
}
data, err := gulu.JSON.MarshalJSON(av)
var data []byte
if util.UseSingleLineSave {
data, err = gulu.JSON.MarshalJSON(av)
} else {
data, err = gulu.JSON.MarshalIndentJSON(av, "", "\t")
}
if nil != err {
logging.LogErrorf("marshal attribute view [%s] failed: %s", av.ID, err)
return

View file

@ -30,7 +30,7 @@ type FileTree struct {
AllowCreateDeeper bool `json:"allowCreateDeeper"` // 允许创建超过 7 层深度的子文档
RemoveDocWithoutConfirm bool `json:"removeDocWithoutConfirm"` // 删除文档时是否不需要确认
CloseTabsOnStart bool `json:"closeTabsOnStart"` // 启动时关闭所有页签
UseSingleLineSave bool `json:"useSingleLineSave"` // 使用单行保存 .sy 文件
UseSingleLineSave bool `json:"useSingleLineSave"` // 使用单行保存文档 .sy 和属性视图 .json
Sort int `json:"sort"` // 排序方式
}