Ignore the backup option when removing backup

When we need to remove existing backup for whatever reason (e.g. because
we've just successfully saved the file), we should do that regardless of
whether backups are enabled or not, since a backup may exist regardless
(it could have been created before the `backup` option got disabled).
This commit is contained in:
Dmytro Maluka
2025-08-02 23:09:16 +02:00
parent e127f08251
commit 04b878bc2d

View File

@@ -126,7 +126,7 @@ func (b *SharedBuffer) Backup() error {
// RemoveBackup removes any backup file associated with this buffer
func (b *SharedBuffer) RemoveBackup() {
if !b.Settings["backup"].(bool) || b.keepBackup() || b.Path == "" || b.Type != BTDefault {
if b.keepBackup() || b.Path == "" || b.Type != BTDefault {
return
}
f := util.DetermineEscapePath(b.backupDir(), b.AbsPath)