fix: timer is global too

This commit is contained in:
əlemi 2024-09-06 03:44:18 +02:00
parent ef37731877
commit a74355f6a0
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -4,6 +4,7 @@ if CODEMP == nil then
rt = nil, rt = nil,
session = nil, session = nil,
native = nil, native = nil,
timer = nil,
config = { config = {
neo_tree = false, neo_tree = false,
timer_interval = 100, timer_interval = 100,
@ -43,9 +44,9 @@ if CODEMP == nil then
) )
end end
if timer == nil then if CODEMP.timer == nil then
timer = vim.loop.new_timer() CODEMP.timer = vim.loop.new_timer()
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 = CODEMP.native.poll_callback() local cb = CODEMP.native.poll_callback()
if cb == nil then break end if cb == nil then break end