fix: use vim.uv instead of vim.loop if it exists

This commit is contained in:
swaits committed 2023-11-07 17:52:08 -07:00
1 parent 55d308a5d3
commit 70f1ab8bb8
2 files changed
+4 -2

No files matched your search

+2 -1
View File
@@ -18,7 +18,8 @@ function FileWatcher.new(path, callback)
self.path = path
self.callback = callback
-- Initialize the file system watcher with libuv.
self.fs_watcher = vim.loop.new_fs_event()
local uv = vim.uv or vim.loop
self.fs_watcher = uv.new_fs_event()
return self
end
+2 -1
View File
@@ -22,7 +22,8 @@ function M.debounce(func, delay)
end
-- Create a new timer.
timer = vim.loop.new_timer()
local uv = vim.uv or vim.loop
timer = uv.new_timer()
-- Start the timer with the specified delay.
timer:start(