fix(#2370): Better "y/N" prompts (#2377)

* Changed the default y/n prompt to default to N in most cases(all delete cases) and made it so that the copy paste same name conflict defaults to R(ename)

* Removed all No conditions as they are not used and not needed

* Made item_short into lowercase and also fixed prompts in dressing.nvim and telescope-select.nvim

* Fixed the exception which occurs on pressing esc in the prompt and also made rename to be blank or r.*/R.*
This commit is contained in:
Mohamed Arish
2023-08-20 13:04:14 +05:30
committed by GitHub
parent 7c4c7e4e98
commit 920868dba1
5 changed files with 12 additions and 10 deletions

View File

@@ -110,12 +110,12 @@ local function do_single_paste(source, dest, action_type, action_fn)
end)
else
local prompt_select = "Overwrite " .. dest .. " ?"
local prompt_input = prompt_select .. " y/n/r(ename): "
lib.prompt(prompt_input, prompt_select, { "y", "n", "r" }, { "Yes", "No", "Rename" }, function(item_short)
local prompt_input = prompt_select .. " R(ename)/y/n: "
lib.prompt(prompt_input, prompt_select, { "", "y", "n" }, { "Rename", "Yes", "No" }, function(item_short)
utils.clear_prompt()
if item_short == "y" then
on_process()
elseif item_short == "r" then
elseif item_short == "" or item_short == "r" then
vim.ui.input({ prompt = "Rename to ", default = dest, completion = "dir" }, function(new_dest)
utils.clear_prompt()
if new_dest then