Progress
parent
4526625f32
commit
0826179c90
|
|
@ -252,13 +252,6 @@ function M.setup(opts)
|
|||
if config.autostart and M.allowed_dir() and vim.g.persisting == nil and not start_args then
|
||||
M.start()
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "PersistedSavePost",
|
||||
callback = function()
|
||||
print("After Saved callback")
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@ end
|
|||
---@param session table
|
||||
function M.load_session(session)
|
||||
fire("TelescopeLoadPre")
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "PersistedLoadPost",
|
||||
callback = function()
|
||||
vim.print("session loaded!!!")
|
||||
fire("TelescopeLoadPost")
|
||||
return true -- returning deletes autocmd after fired
|
||||
end,
|
||||
|
|
@ -34,16 +34,15 @@ function M.load_session(session)
|
|||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "PersistedSavePost",
|
||||
callback = function()
|
||||
-- vim.schedule(function()
|
||||
vim.print("delete and load")
|
||||
-- for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||
-- vim.api.nvim_buf_delete(buf, { force = true })
|
||||
-- end
|
||||
persisted.load({ session = session.file_path })
|
||||
-- end)
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
persisted.save({ session = vim.g.persisted_loaded_session })
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue