feat(notify): switch all print/nvim_*write statements to utils.notify
This commit is contained in:
@@ -36,7 +36,7 @@ end
|
||||
local function remove_dir(cwd)
|
||||
local handle = luv.fs_scandir(cwd)
|
||||
if type(handle) == "string" then
|
||||
return a.nvim_err_writeln(handle)
|
||||
return utils.notify.error(handle)
|
||||
end
|
||||
|
||||
while true do
|
||||
@@ -75,17 +75,18 @@ function M.fn(node)
|
||||
if node.nodes ~= nil and not node.link_to then
|
||||
local success = remove_dir(node.absolute_path)
|
||||
if not success then
|
||||
return a.nvim_err_writeln("Could not remove " .. node.name)
|
||||
return utils.notify.error("Could not remove " .. node.name)
|
||||
end
|
||||
events._dispatch_folder_removed(node.absolute_path)
|
||||
else
|
||||
local success = luv.fs_unlink(node.absolute_path)
|
||||
if not success then
|
||||
return a.nvim_err_writeln("Could not remove " .. node.name)
|
||||
return utils.notify.error("Could not remove " .. node.name)
|
||||
end
|
||||
events._dispatch_file_removed(node.absolute_path)
|
||||
clear_buffer(node.absolute_path)
|
||||
end
|
||||
utils.notify.info(node.absolute_path .. " was properly removed.")
|
||||
if M.enable_reload then
|
||||
require("nvim-tree.actions.reloaders.reloaders").reload_explorer()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user