From bab39079b35652e9810b676320e7b445d1e5f242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6ran=20Karl?= <3951388+JoeKar@users.noreply.github.com> Date: Sun, 12 Oct 2025 18:42:22 +0200 Subject: [PATCH] save: Remove a possible written backup in case the path has changed --- internal/buffer/save.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/buffer/save.go b/internal/buffer/save.go index 96db874d..16e6ed31 100644 --- a/internal/buffer/save.go +++ b/internal/buffer/save.go @@ -331,6 +331,10 @@ func (b *Buffer) saveToFile(filename string, withSudo bool, autoSave bool) error } newPath := b.Path != filename + if newPath { + b.RemoveBackup() + } + b.Path = filename b.AbsPath = absFilename b.isModified = false