rename init.lua to main.lua

master
Bryan 2025-01-18 10:37:07 -06:00
parent 8cf45e08ef
commit e57c3dcd47
1 changed files with 23 additions and 8 deletions

View File

@ -10,26 +10,41 @@ local selected_or_hovered = ya.sync(function()
end)
local confirm_remove = function(file)
local title = 'Remove "' .. file.name .. '"? y/n/a/c '
local title = "Remove " .. file.name .. "? y/n/a/c "
local w = #title
local val, event = ya.input({
local input = ya.input({
title = title,
value = "y",
position = { "top-center", w = w },
})
if event ~= 1 then
return "n"
end
if val == "y" then
if input == "y" then
return "y"
elseif val == "a" then
elseif input == "a" then
return "a"
elseif val == "n" then
elseif input == "n" then
return "n"
else
return "c"
end
-- end
-- local cand = ya.which({
-- cands = {
-- { on = "y", desc = "Yes" },
-- { on = "n", desc = "No" },
-- { on = "a", desc = "All" },
-- },
-- silent = true,
-- })
-- if cand == 1 then
-- return "y"
-- elseif cand == 2 then
-- return "n"
-- elseif cand == 3 then
-- return "a"
-- else
-- return "c"
-- end
end
local remove_file = function(file)