refactor: use vim.ui.input for y/n selections

also add clear_prompt again.
fixes #1441
This commit is contained in:
kiyan
2022-07-19 11:30:24 +02:00
parent b754eb8359
commit 8dc2144e87
8 changed files with 23 additions and 15 deletions

View File

@@ -94,11 +94,13 @@ local function do_single_paste(source, dest, action_type, action_fn)
end
if dest_stats then
vim.ui.select({ "y", "n", "rename" }, { prompt = dest .. " already exists. Overwrite?" }, function(choice)
vim.ui.input({ prompt = dest .. " already exists. Overwrite? y/n/r(ename): " }, function(choice)
utils.clear_prompt()
if choice == "y" then
on_process()
elseif choice == "rename" then
elseif choice == "r" then
vim.ui.input({ prompt = "New name: ", default = dest, completion = "dir" }, function(new_dest)
utils.clear_prompt()
if new_dest then
do_single_paste(source, new_dest, action_type, action_fn)
end