fix: prevent double running of git command

Should improve loading times significantly
main
olimorris 2023-12-18 23:22:10 +00:00
parent 86ce6f14ae
commit bcdada28d2
2 changed files with 1 additions and 4 deletions

View File

@ -89,10 +89,6 @@ end
function M.setup(opts) function M.setup(opts)
config.setup(opts) config.setup(opts)
if M.session_exists() then
vim.g.persisted_exists = true
end
if if
config.options.autosave config.options.autosave
and (allow_dir() and not ignore_dir() and vim.g.persisting == nil) and (allow_dir() and not ignore_dir() and vim.g.persisting == nil)

View File

@ -86,6 +86,7 @@ function M.load_session(session, silent)
return echoerr("Error loading the session! ", result) return echoerr("Error loading the session! ", result)
end end
vim.g.persisted_exists = true
vim.g.persisted_loaded_session = session vim.g.persisted_loaded_session = session
vim.api.nvim_exec_autocmds("User", { pattern = "PersistedLoadPost", data = session }) vim.api.nvim_exec_autocmds("User", { pattern = "PersistedLoadPost", data = session })
end end