Skip to content

Commit

Permalink
use vim.loop if vim.uv is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
hrsh7th committed Nov 25, 2024
1 parent 746896c commit ed31156
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/cmp/source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ed31156

Please sign in to comment.