diff --git a/lua/colorsaver/file_watcher.lua b/lua/colorsaver/file_watcher.lua index 3034102..9335464 100644 --- a/lua/colorsaver/file_watcher.lua +++ b/lua/colorsaver/file_watcher.lua @@ -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 diff --git a/lua/colorsaver/utils.lua b/lua/colorsaver/utils.lua index a88d3dd..35083ee 100644 --- a/lua/colorsaver/utils.lua +++ b/lua/colorsaver/utils.lua @@ -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(