fix: ack when applying changes

This commit is contained in:
əlemi 2024-10-26 18:28:40 +02:00
parent c92b1799b6
commit 7f0dd45ac0
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -142,6 +142,9 @@ local function attach(name, opts)
print(" ~~ applying change ~~ " .. event.change.start_idx .. ".." .. event.change.end_idx .. "::[" .. event.change.content .. "]") print(" ~~ applying change ~~ " .. event.change.start_idx .. ".." .. event.change.end_idx .. "::[" .. event.change.content .. "]")
end end
utils.buffer.set_content(buffer, event.change.content, event.change.start_idx, event.change.end_idx) utils.buffer.set_content(buffer, event.change.content, event.change.start_idx, event.change.end_idx)
controller:ack(event.version)
-- error detection
if event.hash ~= nil then if event.hash ~= nil then
if CODEMP.native.hash(utils.buffer.get_content(buffer)) ~= event.hash then if CODEMP.native.hash(utils.buffer.get_content(buffer)) ~= event.hash then
if CODEMP.config.auto_sync then if CODEMP.config.auto_sync then