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.
This commit is contained in:
David Pedersen authored and gokcehan committed 2019-12-18 01:39:02 +03:00
1 parent d5f989f373
commit d63e7a2076
1 file changed
+3
+3
View File
@@ -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 != "" {