rename init.lua to main.lua
parent
8cf45e08ef
commit
e57c3dcd47
|
|
@ -10,26 +10,41 @@ local selected_or_hovered = ya.sync(function()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local confirm_remove = function(file)
|
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 w = #title
|
||||||
local val, event = ya.input({
|
local input = ya.input({
|
||||||
title = title,
|
title = title,
|
||||||
value = "y",
|
value = "y",
|
||||||
position = { "top-center", w = w },
|
position = { "top-center", w = w },
|
||||||
})
|
})
|
||||||
|
|
||||||
if event ~= 1 then
|
if input == "y" then
|
||||||
return "n"
|
|
||||||
end
|
|
||||||
if val == "y" then
|
|
||||||
return "y"
|
return "y"
|
||||||
elseif val == "a" then
|
elseif input == "a" then
|
||||||
return "a"
|
return "a"
|
||||||
elseif val == "n" then
|
elseif input == "n" then
|
||||||
return "n"
|
return "n"
|
||||||
else
|
else
|
||||||
return "c"
|
return "c"
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
local remove_file = function(file)
|
local remove_file = function(file)
|
||||||
Loading…
Reference in New Issue