micro: Provide recovery of settings.json & bindings.json

This commit is contained in:
Jöran Karl
2024-09-08 12:42:18 +02:00
parent e15bb88270
commit c4dcef3e66
2 changed files with 44 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ import (
"github.com/zyedidia/micro/v2/internal/util"
)
const backupMsg = `A backup was detected for this file. This likely means that micro
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.
@@ -131,7 +131,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, 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 {