mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 15:34:53 +01:00
fix: catch callback errors
very ugly code! will need a fix rust-side...
This commit is contained in:
parent
6b3e4a3faa
commit
51d6628fd4
1 changed files with 7 additions and 3 deletions
|
@ -45,10 +45,14 @@ if CODEMP == nil then
|
||||||
CODEMP.timer = vim.loop.new_timer()
|
CODEMP.timer = vim.loop.new_timer()
|
||||||
CODEMP.timer:start(CODEMP.config.timer_interval, CODEMP.config.timer_interval, function()
|
CODEMP.timer:start(CODEMP.config.timer_interval, CODEMP.config.timer_interval, function()
|
||||||
while true do
|
while true do
|
||||||
local cb, arg = CODEMP.native.poll_callback()
|
local success, cb, arg = pcall(CODEMP.native.poll_callback)
|
||||||
|
if not success then
|
||||||
|
print(vim.inspect(cb))
|
||||||
|
else
|
||||||
if cb == nil then break end
|
if cb == nil then break end
|
||||||
vim.schedule(function() cb(arg) end)
|
vim.schedule(function() cb(arg) end)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
require('codemp.command') -- not really related but should only happen once
|
require('codemp.command') -- not really related but should only happen once
|
||||||
|
|
Loading…
Reference in a new issue