feat: add confirmation kind to select y/n

This commit is contained in:
kiyan
2022-07-18 14:38:32 +02:00
parent 1018a83e10
commit ba5c18dc2b
3 changed files with 10 additions and 6 deletions

View File

@@ -19,11 +19,15 @@ end
local function create_file(file)
if utils.file_exists(file) then
vim.ui.select({ "y", "n" }, { prompt = file .. " already exists. Overwrite?" }, function(choice)
if choice == "y" then
create_and_notify(file)
vim.ui.select(
{ "y", "n" },
{ kind = "confirmation", prompt = file .. " already exists. Overwrite?" },
function(choice)
if choice == "y" then
create_and_notify(file)
end
end
end)
)
else
create_and_notify(file)
end