🎨 When New document save location is configured as ../, it will be completed as ../Untitled Fix https://github.com/siyuan-note/siyuan/issues/8238

This commit is contained in:
Liang Ding 2023-05-12 16:34:09 +08:00
parent 0bfc2b5c64
commit 182f767469
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 23 additions and 0 deletions

View file

@ -175,6 +175,9 @@ func InitConf() {
Conf.FileTree.MaxOpenTabCount = 32
}
Conf.FileTree.DocCreateSavePath = strings.TrimSpace(Conf.FileTree.DocCreateSavePath)
if "../" == Conf.FileTree.DocCreateSavePath {
Conf.FileTree.DocCreateSavePath = "../Untitled"
}
for strings.HasSuffix(Conf.FileTree.DocCreateSavePath, "/") {
Conf.FileTree.DocCreateSavePath = strings.TrimSuffix(Conf.FileTree.DocCreateSavePath, "/")
Conf.FileTree.DocCreateSavePath = strings.TrimSpace(Conf.FileTree.DocCreateSavePath)