fix: set tick also when resynching

This commit is contained in:
əlemi 2024-11-17 17:01:55 +01:00
parent cc9b6769c2
commit ce6670fdb7
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -143,6 +143,7 @@ local function attach(name, opts)
if event.hash ~= nil and CODEMP.native.hash(utils.buffer.get_content(buffer)) ~= event.hash then
if CODEMP.config.auto_sync then
print(" /!\\ out of sync, resynching...")
ticks[buffer] = vim.api.nvim_buf_get_changedtick(buffer)
utils.buffer.set_content(buffer, controller:content():await())
else
vim.ui.select(
@ -150,6 +151,7 @@ local function attach(name, opts)
{ prompt = "out of sync! force resync or detach?" },
function (choice)
if choice == "sync" then
ticks[buffer] = vim.api.nvim_buf_get_changedtick(buffer)
utils.buffer.set_content(buffer, controller:content():await())
end
if choice == "detach" then