Upated context_manager

Added a getter function to return the current state of the global
context manager.
This commit is contained in:
Ethan Smith-Coss 2023-01-13 16:02:11 +00:00 committed by Gitea
parent 18f7e1d9bb
commit 865bb41609

View File

@ -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