Skip to content

Commit

Permalink
fix(cache): vim.loop fallback (#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
ribru17 authored Mar 22, 2024
1 parent 3132d7d commit 9131ea4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lua/lazy/core/cache.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local uv = vim.uv
local uv = vim.uv or vim.loop

local M = {}

Expand Down Expand Up @@ -51,7 +51,7 @@ end
---@private
function Loader.normalize(path)
if path:sub(1, 1) == "~" then
local home = vim.uv.os_homedir() or "~"
local home = uv.os_homedir() or "~"
if home:sub(-1) == "\\" or home:sub(-1) == "/" then
home = home:sub(1, -2)
end
Expand Down Expand Up @@ -442,9 +442,9 @@ function Loader.lsmod(path)
if not Loader._indexed[path] then
local start = uv.hrtime()
Loader._indexed[path] = {}
local handle = vim.uv.fs_scandir(path .. "/lua")
local handle = uv.fs_scandir(path .. "/lua")
while handle do
local name, t = vim.uv.fs_scandir_next(handle)
local name, t = uv.fs_scandir_next(handle)
if not name then
break
end
Expand Down Expand Up @@ -480,7 +480,7 @@ function M._profile_loaders()
for l, loader in pairs(package.loaders) do
local loc = debug.getinfo(loader, "Sn").source:sub(2)
package.loaders[l] = function(modname)
local start = vim.uv.hrtime()
local start = uv.hrtime()
local ret = loader(modname)
Loader.track("loader " .. l .. ": " .. loc, start)
Loader.track("loader_all", start)
Expand Down

0 comments on commit 9131ea4

Please sign in to comment.