No backups for no name files

This commit is contained in:
Zachary Yedidia
2019-12-22 13:43:29 -05:00
parent c4d5d7c195
commit fc706bc404
7 changed files with 18 additions and 11 deletions

View File

@@ -26,7 +26,7 @@ Options: [r]ecover, [i]gnore: `
// Backup saves the current buffer to ConfigDir/backups
func (b *Buffer) Backup(checkTime bool) error {
if !b.Settings["backup"].(bool) {
if !b.Settings["backup"].(bool) || b.Path == "" {
return nil
}
@@ -79,7 +79,7 @@ func (b *Buffer) Backup(checkTime bool) error {
// RemoveBackup removes any backup file associated with this buffer
func (b *Buffer) RemoveBackup() {
if !b.Settings["backup"].(bool) {
if !b.Settings["backup"].(bool) || b.Path == "" {
return
}
f := config.ConfigDir + "/backups/" + util.EscapePath(b.AbsPath)