Skip to content

Commit 4309646

Browse files
committed
loop
1 parent 257b729 commit 4309646

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lua/chadtree.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ local cwd = (function()
1111
return vim.api.nvim_call_function("fnamemodify", {file, ":p:h:h"})
1212
end)()
1313

14+
local loop = vim.uv or vim.loop
15+
1416
local function defer(timeout, callback)
15-
local timer = vim.loop.new_timer()
17+
local timer = loop.new_timer()
1618
timer:start(
1719
timeout,
1820
0,
@@ -145,7 +147,7 @@ local set_chad_call = function(cmd)
145147
chad[cmd] = function(...)
146148
local args = {...}
147149
if t1 == 0 then
148-
t1 = vim.loop.now()
150+
t1 = loop.now()
149151
end
150152

151153
if not job_id then
@@ -164,7 +166,7 @@ local set_chad_call = function(cmd)
164166

165167
if not err_exit and CHAD[cmd] then
166168
CHAD[cmd](args)
167-
local t2 = vim.loop.now()
169+
local t2 = loop.now()
168170
if settings().profiling and t1 >= 0 then
169171
print("Init " .. (t2 - t1) .. "ms")
170172
end

0 commit comments

Comments
 (0)