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
parent 7908c64c00
commit 686dbd9ae4
Signed by: TheOnePath
GPG Key ID: 4E7D436CE1A0BAF1

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