From e57c3dcd470fea4b11091d9db94d345038f98540 Mon Sep 17 00:00:00 2001 From: Bryan Date: Sat, 18 Jan 2025 10:37:07 -0600 Subject: [PATCH] rename init.lua to main.lua --- init.lua => main.lua | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) rename init.lua => main.lua (75%) diff --git a/init.lua b/main.lua similarity index 75% rename from init.lua rename to main.lua index ce796ca..949b326 100644 --- a/init.lua +++ b/main.lua @@ -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)