fix: update window after disconnecting

This commit is contained in:
əlemi 2024-10-12 23:27:08 +02:00
parent 594330c721
commit f5a5287065
Signed by: alemi
GPG key ID: A4895B84D311642C
3 changed files with 3 additions and 0 deletions

View file

@ -87,6 +87,7 @@ local connected_actions = {
print(" xx disconnecting client " .. CODEMP.client.id) print(" xx disconnecting client " .. CODEMP.client.id)
CODEMP.client = nil -- should drop and thus close everything CODEMP.client = nil -- should drop and thus close everything
collectgarbage("collect") -- make sure we drop collectgarbage("collect") -- make sure we drop
require('codemp.window').update()
end, end,
} }

View file

@ -46,6 +46,7 @@ if CODEMP == nil then
CODEMP.client = nil -- drop reference so it gets garbage collected CODEMP.client = nil -- drop reference so it gets garbage collected
end end
CODEMP.rt:stop() CODEMP.rt:stop()
require('codemp.window').update()
end end
} }
) )

View file

@ -118,6 +118,7 @@ M.delete = function(state, path, extra)
if not choice or not vim.startswith(string.lower(choice), "y") then return end if not choice or not vim.startswith(string.lower(choice), "y") then return end
if CODEMP.workspace ~= nil then ws_manager.leave() end if CODEMP.workspace ~= nil then ws_manager.leave() end
CODEMP.client = nil CODEMP.client = nil
manager.refresh("codemp")
collectgarbage("collect") -- to make sure we drop the reference and disconnect collectgarbage("collect") -- to make sure we drop the reference and disconnect
end) end)
elseif selected.type == "root" and vim.startswith(selected.name, "#") then elseif selected.type == "root" and vim.startswith(selected.name, "#") then