feat: paste and create always target closed folder, remove create_in_closed_folder (#1802)

* Fix default for file creation in closed directories

* Make paste in closed directories consistent with create

* doc: clarify create_in_closed_folder

* Remove create_in_closed_folder option

* doc: clarify create_in_closed_folder removal message (whoops)

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Eric Haynes
2022-12-10 22:40:38 -05:00
committed by GitHub
parent b9aaf805a1
commit 7177d95ac0
5 changed files with 6 additions and 19 deletions

View File

@@ -161,11 +161,8 @@ local function do_paste(node, action_type, action_fn)
return
end
local is_dir = stats and stats.type == "directory"
if not is_dir then
destination = vim.fn.fnamemodify(destination, ":p:h")
elseif not node.open then
destination = vim.fn.fnamemodify(destination, ":p:h:h")
end
for _, _node in ipairs(clip) do

View File

@@ -42,8 +42,7 @@ local function get_num_nodes(iter)
end
local function get_containing_folder(node)
local is_open = M.create_in_closed_folder or node.open
if node.nodes ~= nil and is_open then
if node.nodes ~= nil then
return utils.path_add_trailing(node.absolute_path)
end
local node_name_size = #(node.name or "")
@@ -113,7 +112,6 @@ function M.fn(node)
end
function M.setup(opts)
M.create_in_closed_folder = opts.create_in_closed_folder
M.enable_reload = not opts.filesystem_watchers.enable
end