We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bfe1023 commit 3a116fbCopy full SHA for 3a116fb
1 file changed
filemanager-plugin/filemanager.lua
@@ -647,6 +647,13 @@ function rename_at_cursor(bp, args)
647
local old_path = scanlist[y].abspath
648
-- Join the path into their supplied rename, so that we have an absolute path
649
local new_path = dirname_and_join(old_path, new_name)
650
+
651
+ -- Check if the name is already taken by a file/dir
652
+ if path_exists(new_path) then
653
+ micro.InfoBar():Error("You can't create a file/dir with a pre-existing name")
654
+ return
655
+ end
656
657
-- Use Go's os package for renaming the file/dir
658
local golib_os = import("os")
659
-- Actually rename the file
0 commit comments