Skip to content

Commit bab3907

Browse files
committed
save: Remove a possible written backup in case the path has changed
1 parent 02611f4 commit bab3907

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/buffer/save.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ func (b *Buffer) saveToFile(filename string, withSudo bool, autoSave bool) error
331331
}
332332

333333
newPath := b.Path != filename
334+
if newPath {
335+
b.RemoveBackup()
336+
}
337+
334338
b.Path = filename
335339
b.AbsPath = absFilename
336340
b.isModified = false

0 commit comments

Comments
 (0)