From ed31156aa2cc14e3bc066c59357cc91536a2bc01 Mon Sep 17 00:00:00 2001 From: hrsh7th <629908+hrsh7th@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:52:47 +0900 Subject: [PATCH] use vim.loop if vim.uv is not defined --- lua/cmp/source.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/cmp/source.lua b/lua/cmp/source.lua index 8095d4628..74bd3d092 100644 --- a/lua/cmp/source.lua +++ b/lua/cmp/source.lua @@ -113,7 +113,7 @@ source.get_entries = function(self, ctx) local matching_config = self:get_matching_config() local filtering_context_budget = config.get().performance.filtering_context_budget / 1000 - local stime = vim.uv.hrtime() / 1000000 + local stime = (vim.uv or vim.loop).hrtime() / 1000000 for _, e in ipairs(target_entries) do local o = e.offset if not inputs[o] then @@ -132,7 +132,7 @@ source.get_entries = function(self, ctx) end end - local etime = vim.uv.hrtime() / 1000000 + local etime = (vim.uv or vim.loop).hrtime() / 1000000 if etime - stime > filtering_context_budget then async.yield() if ctx.aborted then