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