Sync with latest libmutton development version (new config file format)

This commit is contained in:
2025-12-17 00:41:44 -05:00
parent fb70b38dc3
commit 48ecf7cf83
4 changed files with 16 additions and 11 deletions
+8 -3
View File
@@ -95,11 +95,16 @@ func editNote(baseNote []string) ([]string, bool) {
}(tempFile.Name())
// fetch the user's text editor
editorCfg, err := cfg.ParseConfig([][2]string{{"MUTN", "textEditor"}})
cfg, err := cfg.LoadConfig()
if err != nil {
other.PrintError("Failed to retrieve text editor from libmutton.ini\n\nPlease specify one with \"mutn tweak\"", back.ErrorRead)
other.PrintError("Failed to load libmuttoncfg.json: "+err.Error(), back.ErrorRead)
}
var editor string
if value, exists := (*cfg.ThirdParty)["mutnTextEditor"]; !exists {
other.PrintError("Failed to retrieve text editor from libmuttoncfg.json\n\nPlease specify one with \"mutn tweak\"", back.ErrorRead)
} else {
editor = value.(string)
}
editor := editorCfg[0]
// write baseNote to tempFile (if it is not empty)
baseNoteLen := len(baseNote)