fix: only clear user hl if was present

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

View file

@ -118,8 +118,10 @@ 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
end
user_hl[event.value] = nil
end
elseif event.type == "join" then