feat(remove-file): use vim.ui.select
This commit is contained in:
@@ -68,10 +68,8 @@ function M.fn(node)
|
||||
return
|
||||
end
|
||||
|
||||
print("Remove " .. node.name .. " ? y/n")
|
||||
local ans = utils.get_user_input_char()
|
||||
utils.clear_prompt()
|
||||
if ans:match "^y" then
|
||||
vim.ui.select({ "y", "n" }, { prompt = "Remove " .. node.name .. " ?" }, function(choice)
|
||||
if choice == "y" then
|
||||
if node.nodes ~= nil and not node.link_to then
|
||||
local success = remove_dir(node.absolute_path)
|
||||
if not success then
|
||||
@@ -91,6 +89,7 @@ function M.fn(node)
|
||||
require("nvim-tree.actions.reloaders.reloaders").reload_explorer()
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function M.setup(opts)
|
||||
|
||||
Reference in New Issue
Block a user