feat(#2270): add notify.absolute_path - show file or absolute path (default) names with notifications (#2286)
Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
@@ -74,22 +74,23 @@ end
|
||||
--- Remove a node, notify errors, dispatch events
|
||||
--- @param node table
|
||||
function M.remove(node)
|
||||
local notify_node = notify.render_path(node.absolute_path)
|
||||
if node.nodes ~= nil and not node.link_to then
|
||||
local success = remove_dir(node.absolute_path)
|
||||
if not success then
|
||||
return notify.error("Could not remove " .. node.name)
|
||||
return notify.error("Could not remove " .. notify_node)
|
||||
end
|
||||
events._dispatch_folder_removed(node.absolute_path)
|
||||
else
|
||||
events._dispatch_will_remove_file(node.absolute_path)
|
||||
local success = vim.loop.fs_unlink(node.absolute_path)
|
||||
if not success then
|
||||
return notify.error("Could not remove " .. node.name)
|
||||
return notify.error("Could not remove " .. notify_node)
|
||||
end
|
||||
events._dispatch_file_removed(node.absolute_path)
|
||||
clear_buffer(node.absolute_path)
|
||||
end
|
||||
notify.info(node.absolute_path .. " was properly removed.")
|
||||
notify.info(notify_node .. " was properly removed.")
|
||||
end
|
||||
|
||||
function M.fn(node)
|
||||
|
||||
Reference in New Issue
Block a user