diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index c1ceb796..b9cb76c2 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -230,7 +230,7 @@ func checkBackup(name string) error { input, err := os.ReadFile(backup) if err == nil { t := info.ModTime() - msg := fmt.Sprintf(buffer.BackupMsg, t.Format("Mon Jan _2 at 15:04, 2006"), backup) + msg := fmt.Sprintf(buffer.BackupMsg, target, t.Format("Mon Jan _2 at 15:04, 2006"), backup) choice := screen.TermPrompt(msg, []string{"r", "i", "a", "recover", "ignore", "abort"}, true) if choice%3 == 0 { diff --git a/internal/buffer/backup.go b/internal/buffer/backup.go index 2a05c38c..305d5694 100644 --- a/internal/buffer/backup.go +++ b/internal/buffer/backup.go @@ -14,11 +14,15 @@ import ( "github.com/zyedidia/micro/v2/internal/util" ) -const BackupMsg = `A backup was detected for this file. This likely means that micro -crashed while editing this file, or another instance of micro is currently -editing this file. +const BackupMsg = `A backup was detected for: -The backup was created on %s, and the file is +%s + +This likely means that micro crashed while editing this file, +or another instance of micro is currently editing this file, +or an error occurred while saving this file so it may be corrupted. + +The backup was created on %s and its path is: %s @@ -131,7 +135,7 @@ func (b *Buffer) ApplyBackup(fsize int64) (bool, bool) { if err == nil { defer backup.Close() t := info.ModTime() - msg := fmt.Sprintf(BackupMsg, t.Format("Mon Jan _2 at 15:04, 2006"), backupfile) + msg := fmt.Sprintf(BackupMsg, b.Path, t.Format("Mon Jan _2 at 15:04, 2006"), backupfile) choice := screen.TermPrompt(msg, []string{"r", "i", "a", "recover", "ignore", "abort"}, true) if choice%3 == 0 {