feat: improve deleting sessions via telescope
parent
4f97606552
commit
459adba9dd
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue