mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-12-23 22:04:52 +01:00
fix: slower but correct
This commit is contained in:
parent
6a381bb4ea
commit
78adebd82e
1 changed files with 4 additions and 1 deletions
|
@ -254,7 +254,10 @@ vim.api.nvim_create_user_command(
|
|||
-- hook clientbound callbacks
|
||||
register_controller_handler(args.args, controller, function(event)
|
||||
codemp_changed_tick[buffer] = vim.api.nvim_buf_get_changedtick(buffer)
|
||||
buffer_replace_content(buffer, event.first, event.last, event.content)
|
||||
local before = buffer_get_content(buffer)
|
||||
local after = event:apply(before)
|
||||
buffer_set_content(buffer, after)
|
||||
-- buffer_replace_content(buffer, event.first, event.last, event.content)
|
||||
end, 20) -- wait 20ms before polling again because it overwhelms libuv?
|
||||
|
||||
print(" ++ attached to buffer " .. args.args)
|
||||
|
|
Loading…
Reference in a new issue