mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-05 16:47:20 -04:00
Improve generic UNIX clipboard clearing logic
This commit is contained in:
+2
-2
@@ -91,13 +91,13 @@ func editNote(baseNote []string) ([]string, bool) {
|
|||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(backend.AnsiError + "Failed to write note with " + editor + backend.AnsiReset)
|
panic(backend.AnsiError + "Failed to write note with " + editor + backend.AnsiReset) // panic is used to ensure the tempFile is removed, as per the defer statement
|
||||||
}
|
}
|
||||||
|
|
||||||
// open the tempFile for reading
|
// open the tempFile for reading
|
||||||
tempFile, err = os.Open(tempFile.Name())
|
tempFile, err = os.Open(tempFile.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(backend.AnsiError + "Failed to write note with " + editor + backend.AnsiReset)
|
panic(backend.AnsiError + "Failed to write note with " + editor + backend.AnsiReset) // panic is used to ensure the tempFile is removed, as per the defer statement
|
||||||
}
|
}
|
||||||
|
|
||||||
// read the edited note from the tempFile
|
// read the edited note from the tempFile
|
||||||
|
|||||||
Reference in New Issue
Block a user