From ce6670fdb7ba4c1a838b2849455b51685d33e6c7 Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 17 Nov 2024 17:01:55 +0100 Subject: [PATCH] fix: set tick also when resynching --- lua/codemp/buffers.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/codemp/buffers.lua b/lua/codemp/buffers.lua index 87e499b..e67cd07 100644 --- a/lua/codemp/buffers.lua +++ b/lua/codemp/buffers.lua @@ -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