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