feat: improve deleting sessions via telescope

main
olimorris 2022-07-07 23:08:04 +01:00
parent 4f97606552
commit 459adba9dd
1 changed files with 2 additions and 4 deletions

View File

@ -12,14 +12,12 @@ end
---Delete the selected session from disk ---Delete the selected session from disk
--@return string --@return string
M.delete_session = function() M.delete_session = function()
-- local session = get_selected_session().file_path
local session = get_selected_session() local session = get_selected_session()
local path = session.file_path local path = session.file_path
local confirm = vim.fn.input("Delete " .. session.name .. "? ", "yes"):lower() local confirm = vim.fn.input("Delete [" .. session.name .. "]?: ", ""):lower()
if confirm == "yes" or confirm == "y" then if confirm == "yes" or confirm == "y" then
os.remove(path) vim.fn.delete(vim.fn.expand(path))
print("Session deleted: " .. path)
end end
end end