From f0ac0e981e4c864df11e613636a23c5bad09376d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 6 Jul 2024 21:31:21 +0200 Subject: [PATCH] feat: persistence.active. Check if a session saving is active --- lua/persistence/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/persistence/init.lua b/lua/persistence/init.lua index 34e7c81..1987ed5 100644 --- a/lua/persistence/init.lua +++ b/lua/persistence/init.lua @@ -24,6 +24,11 @@ function M.fire(event) }) end +-- Check if a session is active +function M.active() + return M._current ~= nil +end + function M.start() M._current = M.current() vim.api.nvim_create_autocmd("VimLeavePre", {