Skip to content

Commit

Permalink
feat: move a file to a new directory with its existing name, closes #35
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenxxiu committed Dec 29, 2023
1 parent 7ba13fa commit f352eb8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/genghis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,12 @@ local function fileOp(op)
-- VALIDATION OF FILENAME
if not newName then return end -- input has been canceled

if newName:find("/$") then
newName = newName .. oldName -- use the new directory with the old name
end

local invalidName = newName:find("^%s+$")
or newName:find("[\\:]")
or newName:find("/$")
or (newName:find("^/") and not op == "move-rename")
local sameName = newName == oldName
local emptyInput = newName == ""
Expand Down

0 comments on commit f352eb8

Please sign in to comment.