fix: temporary userdata type check rather than nil

This commit is contained in:
əlemi 2024-11-17 19:26:17 +01:00
parent 3769b2b216
commit 683376be6e
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -140,7 +140,10 @@ local function attach(name, opts)
if event == nil then break end if event == nil then break end
-- error detection -- 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 if CODEMP.config.auto_sync then
print(" /!\\ out of sync, resynching...") print(" /!\\ out of sync, resynching...")
ticks[buffer] = vim.api.nvim_buf_get_changedtick(buffer) ticks[buffer] = vim.api.nvim_buf_get_changedtick(buffer)