Merge pull request #30 from BeauSLM/fix_directory_behaviors

remotes/origin/HEAD
pseudometa 2023-09-09 21:59:52 +02:00 committed by GitHub
commit dd5bc12769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ end
---Performing common file operation tasks
---@param op string rename|duplicate|new|newFromSel
local function fileOp(op)
local dir = expand("%:p:h")
local dir = fn.getcwd()
local oldName = expand("%:t")
local oldFilePath = expand("%:p")
local oldNameNoExt = oldName:gsub("%.%w+$", "")
@ -96,7 +96,7 @@ local function fileOp(op)
-- DETERMINE PATH AND EXTENSION
local hasPath = newName:find("/")
if hasPath then
local newFolder = newName:gsub("/.-$", "")
local newFolder = vim.fs.dirname(newName)
fn.mkdir(newFolder, "p") -- create folders if necessary
end