Revert "Merge pull request #30 from BeauSLM/fix_directory_behaviors"

This reverts commit dd5bc12769, reversing
changes made to 683b422944.
remotes/origin/HEAD
pseudometa 2023-09-09 23:38:44 +02:00
parent 607daa4a40
commit 1a39187841
1 changed files with 2 additions and 2 deletions

View File

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