File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 221221function Clipboard :do_paste (node , action , action_fn )
222222 if node .name == " .." then
223223 node = self .explorer
224- elseif node :is (DirectoryNode ) then
225- node = node :last_group_node ()
224+ else
225+ local dir = node :as (DirectoryNode )
226+ if dir then
227+ node = dir :last_group_node ()
228+ end
226229 end
227230 local clip = self .data [action ]
228231 if # clip == 0 then
@@ -373,7 +376,7 @@ function Clipboard:copy_path(node)
373376 end
374377
375378 local relative_path = utils .path_relative (absolute_path , cwd )
376- content = node . nodes ~= nil and utils .path_add_trailing (relative_path ) or relative_path
379+ content = node : is ( DirectoryNode ) and utils .path_add_trailing (relative_path ) or relative_path
377380 end
378381
379382 self :copy_to_reg (content )
You can’t perform that action at this time.
0 commit comments