Improve backup system

This commit introduces several improvements to the backup system.

* Backups are made every 8 seconds for buffers that have been modified
  since the last backup.

* The `permbackup` option allows users to specify that backups should
  be kept permanently.

* `The backupdir` option allows users to store backups in a custom
   directory.

Fixes #1641
Fixes #1536
Ref #1539 (removes possibility of race condition for backups)
This commit is contained in:
Zachary Yedidia
2020-06-22 17:54:56 -04:00
parent c5136820c4
commit a8332fd316
5 changed files with 68 additions and 27 deletions

View File

@@ -274,7 +274,7 @@ func main() {
fmt.Println("Micro encountered an error:", err)
// backup all open buffers
for _, b := range buffer.OpenBuffers {
b.Backup(false)
b.Backup()
}
// Print the stack trace too
fmt.Print(errors.Wrap(err, 2).ErrorStack())