From 686dbd9ae4cc34a48afd18ca4ea9aa4fc70b4c8a Mon Sep 17 00:00:00 2001 From: TheOnePath Date: Fri, 13 Jan 2023 16:02:11 +0000 Subject: [PATCH] Upated context_manager Added a getter function to return the current state of the global context manager. --- presser/context_manager/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/presser/context_manager/init.lua b/presser/context_manager/init.lua index 37adee6..634a9b5 100644 --- a/presser/context_manager/init.lua +++ b/presser/context_manager/init.lua @@ -103,7 +103,7 @@ end -- @Dev: This is why it's important to guarantee that the IDs are stored in the context manager. They are required here -- to close the windows using the vim API calls, and force closing them too. M.flush = function () - for ctx, ctx_tbl in pairs( g.presser_buf_ctx ) do + for _, ctx_tbl in pairs( g.presser_buf_ctx ) do for _, data in pairs( ctx_tbl ) do print("Deleting:", _, data.id) a.nvim_win_close( data.id, true ) -- buffer contents are irrelevant in this context to save @@ -113,5 +113,8 @@ M.flush = function () g.presser_buf_ctx = {} -- clear the global context manager end +M.get_global_context_manager = function () + return g.presser_buf_ctx +end return M