This reverts commit 38aac09151.
This commit is contained in:
@@ -217,10 +217,10 @@ end
|
||||
---@param action ACTION
|
||||
---@param action_fn fun(source: string, dest: string)
|
||||
function Clipboard:do_paste(node, action, action_fn)
|
||||
if node.name == ".." then
|
||||
node = self.explorer
|
||||
else
|
||||
node = node:last_group_node()
|
||||
node = lib.get_last_group_node(node)
|
||||
local explorer = core.get_explorer()
|
||||
if node.name == ".." and explorer then
|
||||
node = explorer
|
||||
end
|
||||
local clip = self.data[action]
|
||||
if #clip == 0 then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
local utils = require("nvim-tree.utils")
|
||||
local events = require("nvim-tree.events")
|
||||
local lib = require("nvim-tree.lib")
|
||||
local core = require("nvim-tree.core")
|
||||
local notify = require("nvim-tree.notify")
|
||||
|
||||
@@ -39,13 +40,14 @@ local function get_containing_folder(node)
|
||||
return node.absolute_path:sub(0, -node_name_size - 1)
|
||||
end
|
||||
|
||||
---@param node Node?
|
||||
---@param node Node|nil
|
||||
function M.fn(node)
|
||||
local cwd = core.get_cwd()
|
||||
if cwd == nil then
|
||||
return
|
||||
end
|
||||
|
||||
node = node and lib.get_last_group_node(node)
|
||||
if not node or node.name == ".." then
|
||||
node = {
|
||||
absolute_path = cwd,
|
||||
@@ -53,8 +55,6 @@ function M.fn(node)
|
||||
nodes = core.get_explorer().nodes,
|
||||
open = true,
|
||||
}
|
||||
else
|
||||
node = node:last_group_node()
|
||||
end
|
||||
|
||||
local containing_folder = get_containing_folder(node)
|
||||
|
||||
@@ -120,7 +120,7 @@ function M.fn(default_modifier)
|
||||
return
|
||||
end
|
||||
|
||||
node = node:last_group_node()
|
||||
node = lib.get_last_group_node(node)
|
||||
if node.name == ".." then
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user