File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
lua/neo-tree/sources/common Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -326,16 +326,17 @@ end
326326M .delete = function (state , callback )
327327 local tree = state .tree
328328 local node = tree :get_node ()
329- if node .type == " message" then
330- return
329+ if node .type == " file" or node .type == " directory" then
330+ fs_actions .delete_node (node .path , callback )
331+ else
332+ log .warn (" The `delete` command can only be used on files and directories" )
331333 end
332- fs_actions .delete_node (node .path , callback )
333334end
334335
335336M .delete_visual = function (state , selected_nodes , callback )
336337 local paths_to_delete = {}
337338 for _ , node_to_delete in pairs (selected_nodes ) do
338- if node_to_delete .type ~= " message " then
339+ if node_to_delete .type == " file " or node_to_delete . type == " directory " then
339340 table.insert (paths_to_delete , node_to_delete .path )
340341 end
341342 end
You can’t perform that action at this time.
0 commit comments