fix: buf tick equals

in theory it should always be the same, because we call set_content()
and before that resolves our callback runs. HOWEVER, i dont know, nvim
is driving me insane...
This commit is contained in:
əlemi 2024-10-02 14:18:28 +02:00
parent a3fa3ea743
commit 222869464f
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -83,7 +83,7 @@ local function attach(name, opts)
-- TODO breaks when deleting whole lines at buffer end
vim.api.nvim_buf_attach(buffer, false, {
on_bytes = function(_, buf, tick, start_row, start_col, start_offset, old_end_row, old_end_col, old_end_byte_len, new_end_row, new_end_col, new_byte_len)
if tick <= ticks[buf] then return end
if tick == ticks[buf] then return end
if id_buffer_map[buf] == nil then return true end -- unregister callback handler
if CODEMP.config.debug then print(string.format(
"start(row:%s, col:%s) offset:%s end(row:%s, col:%s new(row:%s, col:%s)) len(old:%s, new:%s)",