fix: use vim.uv instead of vim.loop if it exists
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -18,7 +18,8 @@ function FileWatcher.new(path, callback)
|
|||||||
self.path = path
|
self.path = path
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
-- Initialize the file system watcher with libuv.
|
-- 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
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ function M.debounce(func, delay)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Create a new timer.
|
-- 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.
|
-- Start the timer with the specified delay.
|
||||||
timer:start(
|
timer:start(
|
||||||
|
|||||||
Reference in new issue
Block a user