fix(paste): allow pasting into empty root directory

assign main explorer when node name is `..` to allow pasting into the
root directory when its empty.
Fixes #1736
This commit is contained in:
yazdani kiyan 2022-11-16 13:41:35 +01:00
parent 059e4cadd6
commit 1837751efb

View File

@ -145,7 +145,7 @@ end
local function do_paste(node, action_type, action_fn) local function do_paste(node, action_type, action_fn)
node = lib.get_last_group_node(node) node = lib.get_last_group_node(node)
if node.name == ".." then if node.name == ".." then
node = node.parent or core.get_explorer() node = core.get_explorer()
end end
local clip = clipboard[action_type] local clip = clipboard[action_type]
if #clip == 0 then if #clip == 0 then