mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 07:24:52 +01:00
fix: only set content on attach if it differs
This commit is contained in:
parent
335ea236c4
commit
dc6c675615
1 changed files with 5 additions and 2 deletions
|
@ -109,8 +109,11 @@ local function attach(name, buffer, content, nowait)
|
||||||
-- TODO this may happen too soon!!
|
-- TODO this may happen too soon!!
|
||||||
local _ = controller:send(0, #remote_content, content) -- no need to await
|
local _ = controller:send(0, #remote_content, content) -- no need to await
|
||||||
else
|
else
|
||||||
ticks[buffer] = vim.api.nvim_buf_get_changedtick(buffer)
|
local current_content = utils.buffer.get_content(buffer)
|
||||||
utils.buffer.set_content(buffer, remote_content)
|
if current_content ~= remote_content then
|
||||||
|
ticks[buffer] = vim.api.nvim_buf_get_changedtick(buffer)
|
||||||
|
utils.buffer.set_content(buffer, remote_content)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
controller:callback(function (_controller) async:send() end)
|
controller:callback(function (_controller) async:send() end)
|
||||||
|
|
Loading…
Reference in a new issue