mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-28 04:46:41 -04:00
Address JetBrains warnings; bump dependencies
This commit is contained in:
+3
-1
@@ -62,7 +62,9 @@ func CopyMenu(vanityPath string, decSlice []string, oldPassword string) {
|
||||
signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)
|
||||
go func() {
|
||||
<-sigChan
|
||||
clip.ClipClearProcess("")
|
||||
if err = clip.ClearProcess(""); err != nil {
|
||||
other.PrintError("Failed to clear clipboard on exit", global.ErrorClipboard)
|
||||
}
|
||||
os.Exit(0)
|
||||
}()
|
||||
|
||||
|
||||
+3
-4
@@ -95,12 +95,12 @@ func editNote(baseNote []string) ([]string, bool) {
|
||||
}(tempFile.Name())
|
||||
|
||||
// fetch the user's text editor
|
||||
cfg, err := cfg.LoadConfig()
|
||||
config, err := cfg.LoadConfig()
|
||||
if err != nil {
|
||||
other.PrintError("Failed to load libmuttoncfg.json: "+err.Error(), back.ErrorRead)
|
||||
}
|
||||
var editor string
|
||||
if value, exists := (*cfg.ThirdParty)["mutnTextEditor"]; !exists {
|
||||
if value, exists := (*config.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)
|
||||
@@ -165,7 +165,6 @@ func editNote(baseNote []string) ([]string, bool) {
|
||||
noteLen := len(note)
|
||||
if !reflect.DeepEqual(note, baseNote) && (noteLen > 0 || baseNoteLen != noteLen) {
|
||||
return note, true
|
||||
} else {
|
||||
return nil, false
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ fieldLoop:
|
||||
// render notes as Markdown
|
||||
r, _ := glamour.NewTermRenderer(glamour.WithStylesFromJSONBytes(glamourStyle()), glamour.WithPreservedNewLines(), glamour.WithWordWrap(width))
|
||||
markdownNotesString, _ := r.Render(strings.Join(decSlice[4:], "\n"))
|
||||
_ = r.Close()
|
||||
|
||||
// print the rendered Markdown notes
|
||||
fmt.Print(markdownNotesString)
|
||||
|
||||
Reference in New Issue
Block a user