mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 15:34:53 +01:00
fix: mixed up buffer name and id
This commit is contained in:
parent
6ca8a15369
commit
b058f9fa5e
1 changed files with 8 additions and 6 deletions
|
@ -34,20 +34,23 @@ local function register_cursor_handler(controller)
|
||||||
end
|
end
|
||||||
local old_buffer = buffers.users[event.user]
|
local old_buffer = buffers.users[event.user]
|
||||||
if old_buffer ~= nil then
|
if old_buffer ~= nil then
|
||||||
vim.api.nvim_buf_clear_namespace(old_buffer, user_hl[event.user].ns, 0, -1)
|
local old_buffer_id = buffers.map_rev[old_buffer]
|
||||||
|
if old_buffer_id ~= nil then
|
||||||
|
vim.api.nvim_buf_clear_namespace(old_buffer_id, user_hl[event.user].ns, 0, -1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
buffers.users[event.user] = event.buffer
|
buffers.users[event.user] = event.buffer
|
||||||
local buffer = buffers.map_rev[event.buffer]
|
local buffer_id = buffers.map_rev[event.buffer]
|
||||||
if buffer ~= nil then
|
if buffer_id ~= nil then
|
||||||
utils.multiline_highlight(
|
utils.multiline_highlight(
|
||||||
buffer,
|
buffer_id,
|
||||||
user_hl[event.user].ns,
|
user_hl[event.user].ns,
|
||||||
user_hl[event.user].hi,
|
user_hl[event.user].hi,
|
||||||
event.start,
|
event.start,
|
||||||
event.finish
|
event.finish
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if old_buffer ~= buffer then
|
if old_buffer ~= event.buffer then
|
||||||
window.update() -- redraw user positions
|
window.update() -- redraw user positions
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -104,7 +107,6 @@ return {
|
||||||
join = join,
|
join = join,
|
||||||
leave = leave,
|
leave = leave,
|
||||||
map = user_hl,
|
map = user_hl,
|
||||||
colors = available_colors,
|
|
||||||
positions = user_buffer,
|
positions = user_buffer,
|
||||||
open_buffer_tree = open_buffer_tree,
|
open_buffer_tree = open_buffer_tree,
|
||||||
buffer_tree = tree_buf,
|
buffer_tree = tree_buf,
|
||||||
|
|
Loading…
Reference in a new issue