Handle cases where the user initialized libmutton in a different client and has no text editor specified (also allow setting a text editor in the tweak menu)

This commit is contained in:
2025-07-02 22:38:51 -04:00
parent 97d49fdba1
commit 45c03f0fe4
4 changed files with 14 additions and 5 deletions
+4 -1
View File
@@ -88,7 +88,10 @@ func editNote(baseNote []string) ([]string, bool) {
}(tempFile.Name())
// fetch the user's text editor
editorCfg, _ := cfg.ParseConfig([][2]string{{"MUTN", "textEditor"}})
editorCfg, err := cfg.ParseConfig([][2]string{{"MUTN", "textEditor"}})
if err != nil {
other.PrintError("Failed to retrieve text editor from libmutton.ini\n\nPlease specify one with \"mutn tweak\"", back.ErrorRead)
}
editor := editorCfg[0]
// write baseNote to tempFile (if it is not empty)