From d63e7a20762f0a517793a34e80e005a786790e57 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Tue, 17 Dec 2019 23:39:02 +0100 Subject: [PATCH] Don't rename when name is the same. Fix #253 (#266) Currently, renaming a file without changing the name will prompt for replacing and then delete the file. This will instead cancel the renaming if the old and new names are the same. --- eval.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eval.go b/eval.go index 814a00e..377e568 100644 --- a/eval.go +++ b/eval.go @@ -1090,6 +1090,9 @@ func (e *callExpr) eval(app *app, args []string) { } oldPathTo := filepath.Join(wd, curr.Name()) newPathTo := filepath.Join(wd, s) + if oldPathTo == newPathTo { + return + } app.nav.renameCache = []string{oldPathTo, newPathTo} if dir, _ := filepath.Split(s); dir != "" {