mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 07:24:52 +01:00
fix: update position for self too
This commit is contained in:
parent
3f71b36ccd
commit
f8c2a00894
1 changed files with 6 additions and 2 deletions
|
@ -51,23 +51,27 @@ local function register_cursor_callback(controller, name)
|
||||||
end
|
end
|
||||||
local cur = utils.cursor.position()
|
local cur = utils.cursor.position()
|
||||||
local buf = vim.api.nvim_get_current_buf()
|
local buf = vim.api.nvim_get_current_buf()
|
||||||
|
local bufname
|
||||||
if buffers.map[buf] ~= nil then
|
if buffers.map[buf] ~= nil then
|
||||||
|
bufname = buffers.map[buf]
|
||||||
once = true
|
once = true
|
||||||
local _ = controller:send({
|
local _ = controller:send({
|
||||||
buffer = buffers.map[buf],
|
buffer = bufname,
|
||||||
start = cur[1],
|
start = cur[1],
|
||||||
finish = cur[2],
|
finish = cur[2],
|
||||||
}) -- no need to await here
|
}) -- no need to await here
|
||||||
else -- set ourselves "away" only once
|
else -- set ourselves "away" only once
|
||||||
|
bufname = ""
|
||||||
if once then
|
if once then
|
||||||
local _ = controller:send({
|
local _ = controller:send({
|
||||||
buffer = "",
|
buffer = bufname,
|
||||||
start = { 0, 0 },
|
start = { 0, 0 },
|
||||||
finish = { 0, 0 },
|
finish = { 0, 0 },
|
||||||
}) -- no need to await here
|
}) -- no need to await here
|
||||||
end
|
end
|
||||||
once = false
|
once = false
|
||||||
end
|
end
|
||||||
|
buffers.users[CODEMP.client.username] = bufname
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue