From 683376be6e7a756873ee236ad4b4cc3d03857342 Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 17 Nov 2024 19:26:17 +0100 Subject: [PATCH] fix: temporary userdata type check rather than nil --- lua/codemp/buffers.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/codemp/buffers.lua b/lua/codemp/buffers.lua index e67cd07..cb6c5c9 100644 --- a/lua/codemp/buffers.lua +++ b/lua/codemp/buffers.lua @@ -140,7 +140,10 @@ local function attach(name, opts) if event == nil then break end -- error detection - if event.hash ~= nil and CODEMP.native.hash(utils.buffer.get_content(buffer)) ~= event.hash then + -- TODO Option::None gets serialized as userdata : NULL, so nil check doesnt work... + -- next version field will be skipped if hash is None + --if event.hash ~= nil and CODEMP.native.hash(utils.buffer.get_content(buffer)) ~= event.hash then + if type(event.hash) ~= "userdata" 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)