From 2cfc4e3795cec05c8b0b1d98ad57b30ef4d51acc Mon Sep 17 00:00:00 2001 From: Bryan Date: Thu, 17 Oct 2024 07:48:55 -0600 Subject: [PATCH] Add autocmd to maybe fix saving session before leaving --- plugin/cd-project.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin/cd-project.lua b/plugin/cd-project.lua index 580bf87..472a1b4 100644 --- a/plugin/cd-project.lua +++ b/plugin/cd-project.lua @@ -21,3 +21,9 @@ vim.api.nvim_create_user_command("CdProjectManualAdd", adapter.manual_cd_project vim.api.nvim_create_user_command("CdProjectSearchAndAdd", adapter.telescope_search_and_add, {}) vim.api.nvim_create_user_command("CdProjectDelete", adapter.delete_project, {}) vim.api.nvim_create_user_command("CdProjectBack", api.back, {}) + +vim.api.nvim_create_autocmd("VimLeavePre", { + callback = function() + require("persistence").save() + end, +})