🐛 fix(nvim): persisted autocmd is now afected at init

This commit is contained in:
Sergio Laín 2024-08-10 16:17:19 +02:00
parent 12798112ba
commit 2d27e7e8e8
No known key found for this signature in database
GPG key ID: 8429B2EE312F8150

View file

@ -1,14 +1,3 @@
vim.api.nvim_create_autocmd({ "User" }, {
pattern = "PersistedTelescopeLoadPre",
callback = function(session)
-- Save the currently loaded session using a global variable
require("persisted").save({ session = vim.g.persisted_loaded_session })
-- Delete all of the open buffers
vim.api.nvim_input("<ESC>:%bd!<CR>")
end,
})
return {
{
"folke/persistence.nvim",
@ -16,6 +5,18 @@ return {
},
{
"olimorris/persisted.nvim",
init = function()
vim.api.nvim_create_autocmd({ "User" }, {
pattern = "PersistedTelescopeLoadPre",
callback = function(session)
-- Save the currently loaded session using a global variable
require("persisted").save({ session = vim.g.persisted_loaded_session })
-- Delete all of the open buffers
vim.api.nvim_input("<ESC>:%bd!<CR>")
end,
})
end,
lazy = false,
config = function()
LazyVim.on_load("telescope.nvim", function()