Browse Source

:art: Improve code snippet writing https://github.com/siyuan-note/siyuan/issues/13101

Daniel 8 months ago
parent
commit
738a53f43e
1 changed files with 4 additions and 0 deletions
  1. 4 0
      kernel/model/snippet.go

+ 4 - 0
kernel/model/snippet.go

@@ -108,6 +108,10 @@ func writeSnippetsConf(snippets []*conf.Snippet) (err error) {
 	}
 
 	confPath := filepath.Join(util.SnippetsPath, "conf.json")
+	oldData, _ := filelock.ReadFile(confPath)
+	if string(oldData) == string(data) {
+		return
+	}
 	err = filelock.WriteFile(confPath, data)
 	return
 }