fix: print error as err

This commit is contained in:
əlemi 2024-09-18 00:39:52 +02:00
parent 51d6628fd4
commit bf59d71e3b
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -45,11 +45,11 @@ 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 success, cb, arg = pcall(CODEMP.native.poll_callback) local cb, arg = CODEMP.native.poll_callback()
if not success then if cb == nil then break end
print(vim.inspect(cb)) if cb == false then
error(arg)
else else
if cb == nil then break end
vim.schedule(function() cb(arg) end) vim.schedule(function() cb(arg) end)
end end
end end