fix: actually clear usr and check if hl is present

This commit is contained in:
əlemi 2024-09-17 02:01:48 +02:00
parent 321e6a34bb
commit 81baba98db
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -118,10 +118,11 @@ local function join(workspace)
if event.type == "leave" then
if buffers.users[event.value] ~= nil then
local buf_name = buffers.users[event.value]
if buf_name ~= nil then
vim.api.nvim_buf_clear_namespace(buffers.map_rev[buf_name], user_hl[event.value].ns, 0, -1)
buffers.users[event.value] = nil
local buf_id = buffers.map_rev[buf_name]
if buf_id ~= nil then
vim.api.nvim_buf_clear_namespace(buf_id, user_hl[event.value].ns, 0, -1)
end
buffers.users[event.value] = nil
user_hl[event.value] = nil
end
elseif event.type == "join" then